How to use the @microsoft/mixed-reality-extension-sdk.Vector3.Right function in @microsoft/mixed-reality-extension-sdk

To help you get started, we’ve selected a few @microsoft/mixed-reality-extension-sdk examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github microsoft / mixed-reality-extension-sdk-samples / samples / hello-world / src / app.ts View on Github external
transform: {
                    local: {
                        position: { x: 0, y: -1, z: 0 },
                        scale: { x: 0.4, y: 0.4, z: 0.4 }
                    }
                }
            }
        });

        // Grab that early reference again.
        this.cube = cubePromise.value;

        // Create some animations on the cube.
        this.cube.createAnimation(
            'DoAFlip', {
                keyframes: this.generateSpinKeyframes(1.0, Vector3.Right()),
                events: []
            });

        // Now that the text and its animation are all being set up, we can start playing
        // the animation.
        this.text.enableAnimation('Spin');

        // Set up cursor interaction. We add the input behavior ButtonBehavior to the cube.
        // Button behaviors have two pairs of events: hover start/stop, and click start/stop.
        const buttonBehavior = this.cube.setBehavior(ButtonBehavior);

        // Trigger the grow/shrink animations on hover.
        buttonBehavior.onHover('enter', () => {
            this.cube.animateTo(
                { transform: { local: { scale: { x: 0.5, y: 0.5, z: 0.5 } } } }, 0.3, AnimationEaseCurves.EaseOutSine);
        });
github microsoft / mixed-reality-extension-sdk-samples / samples / hello-world / src / app.ts View on Github external
// Parent the glTF model to the text actor.
                parentId: this.text.id,
                transform: {
                    position: { x: 0, y: -1, z: 0 },
                    scale: { x: 0.4, y: 0.4, z: 0.4 }
                }
            }
        });

        // Grab that early reference again.
        this.cube = cubePromise.value;

        // Create some animations on the cube.
        this.cube.createAnimation(
            'DoAFlip', {
                keyframes: this.generateSpinKeyframes(1.0, Vector3.Right()),
                events: []
            });

        // Now that the text and its animation are all being set up, we can start playing
        // the animation.
        this.text.enableAnimation('Spin');

        // Set up cursor interaction. We add the input behavior ButtonBehavior to the cube.
        // Button behaviors have two pairs of events: hover start/stop, and click start/stop.
        const buttonBehavior = this.cube.setBehavior(ButtonBehavior);

        // Trigger the grow/shrink animations on hover.
        buttonBehavior.onHover('enter', (userId: string) => {
            this.cube.animateTo(
                { transform: { scale: { x: 0.5, y: 0.5, z: 0.5 } } }, 0.3, AnimationEaseCurves.EaseOutSine);
        });
github microsoft / mixed-reality-extension-sdk-samples / samples / tic-tac-toe / src / app.ts View on Github external
// Create some animations on the cube.
                cube.createAnimation(
                    'GrowIn', {
                        keyframes: this.growAnimationData,
                        events: []
                    });

                cube.createAnimation(
                    'ShrinkOut', {
                        keyframes: this.shrinkAnimationData,
                        events: []
                    });

                cube.createAnimation(
                    'DoAFlip', {
                        keyframes: this.generateSpinKeyframes(1.0, Vector3.Right()),
                        events: []
                    });

                // Set up cursor interaction. We add the input behavior ButtonBehavior to the cube.
                // Button behaviors have two pairs of events: hover start/stop, and click start/stop.
                const buttonBehavior = cube.setBehavior(ButtonBehavior);

                // Trigger the grow/shrink animations on hover.
                buttonBehavior.onHover('enter', () => {
                    if (this.gameState === GameState.Play &&
                        this.boardState[tileIndexX * 3 + tileIndexZ] === undefined) {
                        cube.enableAnimation('GrowIn');
                    }
                });
                buttonBehavior.onHover('exit', () => {
                    if (this.gameState === GameState.Play &&

@microsoft/mixed-reality-extension-sdk

The Mixed Reality Extension SDK enables developers to build 3D world extensions for AltspaceVR, using Node.JS.

MIT
Latest version published 4 years ago

Package Health Score

48 / 100
Full package analysis