Skip to content
This repository has been archived by the owner on Jun 10, 2022. It is now read-only.

Commit

Permalink
Jabenk/mouse pick (#642)
Browse files Browse the repository at this point in the history
* Add physics bridge (#533)

* Add rigid body ownership (#536)

* Jabenk/physics merge1 (#564)

* [SDK] Animations overhaul part 2 (#532)

* Start filling out animation classes

* Add some fields to Animation

* Fix some build/lint issues

* Finish wiring up SDK

* Strip out all old animation system methods/types

* Stub out AnimateTo

* Fill out AnimateTo

* Type checking

* Fix some bugs

* Update tests for new animation API

* Convert input test

* Finish porting tests

* Fix consistency

* Move relative field

* Fix

* Add vertex colors to test clock

* Add animation lookups to anims and materials

* Start updating test

* Finish up test

* Fix up some stuff

* Fix test permissions?

* Start animation data validation

* Add validation

* More validation

* Debug logging

* Consolidate placeholder name/type checking, add validation error class

* Document thrown exceptions

* Cleanup

* Add track easing

* Start on more thorough test

* Add bouncing cubes test

* Fix interpolations

* Fix duration for anims with data

* Update anim scale test to use relative values

* Don't reset time on anim start if speed is 0

* Add orphaned animation detection, delete method

* Clean up animations when they're orphaned

* Validate target paths as values

* Add dynamic animation test

* Rename test

* Add anim blend test

* Rename interpolation-test

* Comment out unsupported features

* Add back deprecated animateTo

* Add back stub of deprecated createAnimation

* Add isPlaying prop to AnimationLike

* Change return val of AnimateTo, add isPlaying patch prop

* Fix intellisense

* Add looping relative test

* Fix the scale test sliding downward

* Correctly override step interpolation

* Finish relative anim test

* Fix some tests

* Move anim finish state transition to client, fixes

* Allow occasional actor updates through

* Remove post-animation actor updates

* Version bump: 0.17

* npm audit fix

* Publish

 - @microsoft/mixed-reality-extension-altspacevr-extras@0.17.0
 - @microsoft/mixed-reality-extension-common@0.17.0
 - functional-tests@0.17.0
 - @microsoft/gltf-gen@0.17.0
 - @microsoft/mixed-reality-extension-sdk@0.17.0

* Automated: Regenerated documentation for 0.17.0

* Automated: Updated package-lock.json files for 0.17.0

* Fix for grab sync. Fixes #538

* Add bounciness and frictions to the collider

* Add bounce and friction visual tests

* Fine tune friciton demo

* Fix lint errors

* Fix for grab sync. Fixes #538

* Fix lint errors

* [SDK] Add more font types (#537)

* Add more font types

* Change the default font

* Publish

 - @microsoft/mixed-reality-extension-altspacevr-extras@0.17.1
 - @microsoft/mixed-reality-extension-common@0.17.1
 - functional-tests@0.17.1
 - @microsoft/gltf-gen@0.17.1
 - @microsoft/mixed-reality-extension-sdk@0.17.1

* Sync animation updates in create calls (#545)

* Updated package-lock.json files for 0.17.1

* Jabenk/pr (#541)

* Add bounciness and frictions to the collider

* Add bounce and friction visual tests

* Fine tune friciton demo

* PR fixes

* More fixes in naming

* Format the 2 new files with Ctr+A, and then Ctr+K and Ctr+F

* Remove text component from physics planes.

* More merges

* reduce warning

* fix merge errors

Co-authored-by: Steven Vergenz <steven.vergenz@microsoft.com>
Co-authored-by: Eric Anderson <eanders@microsoft.com>

* Jabenk/physics merge1 (#571)

* [SDK] Animations overhaul part 2 (#532)

* Start filling out animation classes

* Add some fields to Animation

* Fix some build/lint issues

* Finish wiring up SDK

* Strip out all old animation system methods/types

* Stub out AnimateTo

* Fill out AnimateTo

* Type checking

* Fix some bugs

* Update tests for new animation API

* Convert input test

* Finish porting tests

* Fix consistency

* Move relative field

* Fix

* Add vertex colors to test clock

* Add animation lookups to anims and materials

* Start updating test

* Finish up test

* Fix up some stuff

* Fix test permissions?

* Start animation data validation

* Add validation

* More validation

* Debug logging

* Consolidate placeholder name/type checking, add validation error class

* Document thrown exceptions

* Cleanup

* Add track easing

* Start on more thorough test

* Add bouncing cubes test

* Fix interpolations

* Fix duration for anims with data

* Update anim scale test to use relative values

* Don't reset time on anim start if speed is 0

* Add orphaned animation detection, delete method

* Clean up animations when they're orphaned

* Validate target paths as values

* Add dynamic animation test

* Rename test

* Add anim blend test

* Rename interpolation-test

* Comment out unsupported features

* Add back deprecated animateTo

* Add back stub of deprecated createAnimation

* Add isPlaying prop to AnimationLike

* Change return val of AnimateTo, add isPlaying patch prop

* Fix intellisense

* Add looping relative test

* Fix the scale test sliding downward

* Correctly override step interpolation

* Finish relative anim test

* Fix some tests

* Move anim finish state transition to client, fixes

* Allow occasional actor updates through

* Remove post-animation actor updates

* Version bump: 0.17

* npm audit fix

* Publish

 - @microsoft/mixed-reality-extension-altspacevr-extras@0.17.0
 - @microsoft/mixed-reality-extension-common@0.17.0
 - functional-tests@0.17.0
 - @microsoft/gltf-gen@0.17.0
 - @microsoft/mixed-reality-extension-sdk@0.17.0

* Automated: Regenerated documentation for 0.17.0

* Automated: Updated package-lock.json files for 0.17.0

* Fix for grab sync. Fixes #538

* Add bounciness and frictions to the collider

* Add bounce and friction visual tests

* Fine tune friciton demo

* Fix lint errors

* Fix for grab sync. Fixes #538

* Fix lint errors

* [SDK] Add more font types (#537)

* Add more font types

* Change the default font

* Publish

 - @microsoft/mixed-reality-extension-altspacevr-extras@0.17.1
 - @microsoft/mixed-reality-extension-common@0.17.1
 - functional-tests@0.17.1
 - @microsoft/gltf-gen@0.17.1
 - @microsoft/mixed-reality-extension-sdk@0.17.1

* Sync animation updates in create calls (#545)

* Updated package-lock.json files for 0.17.1

* Jabenk/pr (#541)

* Add bounciness and frictions to the collider

* Add bounce and friction visual tests

* Fine tune friciton demo

* PR fixes

* More fixes in naming

* Format the 2 new files with Ctr+A, and then Ctr+K and Ctr+F

* Remove text component from physics planes.

* More merges

* reduce warning

* fix merge errors

* split one test in 2 with different bounciness

* fix sync for videostream when duration is 0 (live video/audio) (#569)

* wire up bounciness correctly

* Extend testings

* minor fine tuneing of a demo

Co-authored-by: Steven Vergenz <steven.vergenz@microsoft.com>
Co-authored-by: Eric Anderson <eanders@microsoft.com>
Co-authored-by: Kai <norybiak@gmail.com>

* Jabenk/physics merge1 (#580)

* [SDK] Animations overhaul part 2 (#532)

* Start filling out animation classes

* Add some fields to Animation

* Fix some build/lint issues

* Finish wiring up SDK

* Strip out all old animation system methods/types

* Stub out AnimateTo

* Fill out AnimateTo

* Type checking

* Fix some bugs

* Update tests for new animation API

* Convert input test

* Finish porting tests

* Fix consistency

* Move relative field

* Fix

* Add vertex colors to test clock

* Add animation lookups to anims and materials

* Start updating test

* Finish up test

* Fix up some stuff

* Fix test permissions?

* Start animation data validation

* Add validation

* More validation

* Debug logging

* Consolidate placeholder name/type checking, add validation error class

* Document thrown exceptions

* Cleanup

* Add track easing

* Start on more thorough test

* Add bouncing cubes test

* Fix interpolations

* Fix duration for anims with data

* Update anim scale test to use relative values

* Don't reset time on anim start if speed is 0

* Add orphaned animation detection, delete method

* Clean up animations when they're orphaned

* Validate target paths as values

* Add dynamic animation test

* Rename test

* Add anim blend test

* Rename interpolation-test

* Comment out unsupported features

* Add back deprecated animateTo

* Add back stub of deprecated createAnimation

* Add isPlaying prop to AnimationLike

* Change return val of AnimateTo, add isPlaying patch prop

* Fix intellisense

* Add looping relative test

* Fix the scale test sliding downward

* Correctly override step interpolation

* Finish relative anim test

* Fix some tests

* Move anim finish state transition to client, fixes

* Allow occasional actor updates through

* Remove post-animation actor updates

* Version bump: 0.17

* npm audit fix

* Publish

 - @microsoft/mixed-reality-extension-altspacevr-extras@0.17.0
 - @microsoft/mixed-reality-extension-common@0.17.0
 - functional-tests@0.17.0
 - @microsoft/gltf-gen@0.17.0
 - @microsoft/mixed-reality-extension-sdk@0.17.0

* Automated: Regenerated documentation for 0.17.0

* Automated: Updated package-lock.json files for 0.17.0

* Fix for grab sync. Fixes #538

* Add bounciness and frictions to the collider

* Add bounce and friction visual tests

* Fine tune friciton demo

* Fix lint errors

* Fix for grab sync. Fixes #538

* Fix lint errors

* [SDK] Add more font types (#537)

* Add more font types

* Change the default font

* Publish

 - @microsoft/mixed-reality-extension-altspacevr-extras@0.17.1
 - @microsoft/mixed-reality-extension-common@0.17.1
 - functional-tests@0.17.1
 - @microsoft/gltf-gen@0.17.1
 - @microsoft/mixed-reality-extension-sdk@0.17.1

* Sync animation updates in create calls (#545)

* Updated package-lock.json files for 0.17.1

* Jabenk/pr (#541)

* Add bounciness and frictions to the collider

* Add bounce and friction visual tests

* Fine tune friciton demo

* PR fixes

* More fixes in naming

* Format the 2 new files with Ctr+A, and then Ctr+K and Ctr+F

* Remove text component from physics planes.

* More merges

* reduce warning

* fix merge errors

* split one test in 2 with different bounciness

* fix sync for videostream when duration is 0 (live video/audio) (#569)

* wire up bounciness correctly

* Extend testings

* minor fine tuneing of a demo

* Cleanup lint warnings

* Initial Tool and Pen Behavior Functionality (#570)

* Revert "Merge pull request #497 from microsoft/revert/pen"

This reverts commit ed44094.

* Don't export pen tool for SDK

* Fix bug where action is not found on the behavior

* PR feedback and lint fixes

* Additional PR feedback

* Cleanup

Co-authored-by: Eric Anderson <eanders@microsoft.com>

* Support conditional request headers for static files (#563)

* Support conditional request headers for static files

* Specify index explicitly

* Move restify types to types folder

* Fix conditional request for buffers

* Change missing buffer error from 500 to 404

* Move dependency to sdk package

* Version bump: 0.18.0

* Publish

 - @microsoft/mixed-reality-extension-altspacevr-extras@0.18.0
 - @microsoft/mixed-reality-extension-common@0.18.0
 - functional-tests@0.18.0
 - @microsoft/gltf-gen@0.18.0
 - @microsoft/mixed-reality-extension-sdk@0.18.0

* Automated: Regenerated documentation for 0.18.0

* Automated: Updated package-lock.json files for 0.18.0

* Add test cases with a pile composed of bodies from different clients

Co-authored-by: Steven Vergenz <steven.vergenz@microsoft.com>
Co-authored-by: Eric Anderson <eanders@microsoft.com>
Co-authored-by: Kai <norybiak@gmail.com>
Co-authored-by: Tom Burdak <40439150+tombuMS@users.noreply.github.com>

* Add physics stack demos (#584)

* Jabenk/physics merge1 (#590)

* [SDK] Animations overhaul part 2 (#532)

* Start filling out animation classes

* Add some fields to Animation

* Fix some build/lint issues

* Finish wiring up SDK

* Strip out all old animation system methods/types

* Stub out AnimateTo

* Fill out AnimateTo

* Type checking

* Fix some bugs

* Update tests for new animation API

* Convert input test

* Finish porting tests

* Fix consistency

* Move relative field

* Fix

* Add vertex colors to test clock

* Add animation lookups to anims and materials

* Start updating test

* Finish up test

* Fix up some stuff

* Fix test permissions?

* Start animation data validation

* Add validation

* More validation

* Debug logging

* Consolidate placeholder name/type checking, add validation error class

* Document thrown exceptions

* Cleanup

* Add track easing

* Start on more thorough test

* Add bouncing cubes test

* Fix interpolations

* Fix duration for anims with data

* Update anim scale test to use relative values

* Don't reset time on anim start if speed is 0

* Add orphaned animation detection, delete method

* Clean up animations when they're orphaned

* Validate target paths as values

* Add dynamic animation test

* Rename test

* Add anim blend test

* Rename interpolation-test

* Comment out unsupported features

* Add back deprecated animateTo

* Add back stub of deprecated createAnimation

* Add isPlaying prop to AnimationLike

* Change return val of AnimateTo, add isPlaying patch prop

* Fix intellisense

* Add looping relative test

* Fix the scale test sliding downward

* Correctly override step interpolation

* Finish relative anim test

* Fix some tests

* Move anim finish state transition to client, fixes

* Allow occasional actor updates through

* Remove post-animation actor updates

* Version bump: 0.17

* npm audit fix

* Publish

 - @microsoft/mixed-reality-extension-altspacevr-extras@0.17.0
 - @microsoft/mixed-reality-extension-common@0.17.0
 - functional-tests@0.17.0
 - @microsoft/gltf-gen@0.17.0
 - @microsoft/mixed-reality-extension-sdk@0.17.0

* Automated: Regenerated documentation for 0.17.0

* Automated: Updated package-lock.json files for 0.17.0

* Fix for grab sync. Fixes #538

* Add bounciness and frictions to the collider

* Add bounce and friction visual tests

* Fine tune friciton demo

* Fix lint errors

* Fix for grab sync. Fixes #538

* Fix lint errors

* [SDK] Add more font types (#537)

* Add more font types

* Change the default font

* Publish

 - @microsoft/mixed-reality-extension-altspacevr-extras@0.17.1
 - @microsoft/mixed-reality-extension-common@0.17.1
 - functional-tests@0.17.1
 - @microsoft/gltf-gen@0.17.1
 - @microsoft/mixed-reality-extension-sdk@0.17.1

* Sync animation updates in create calls (#545)

* Updated package-lock.json files for 0.17.1

* Jabenk/pr (#541)

* Add bounciness and frictions to the collider

* Add bounce and friction visual tests

* Fine tune friciton demo

* PR fixes

* More fixes in naming

* Format the 2 new files with Ctr+A, and then Ctr+K and Ctr+F

* Remove text component from physics planes.

* More merges

* reduce warning

* fix merge errors

* split one test in 2 with different bounciness

* fix sync for videostream when duration is 0 (live video/audio) (#569)

* wire up bounciness correctly

* Extend testings

* minor fine tuneing of a demo

* Cleanup lint warnings

* Initial Tool and Pen Behavior Functionality (#570)

* Revert "Merge pull request #497 from microsoft/revert/pen"

This reverts commit ed44094.

* Don't export pen tool for SDK

* Fix bug where action is not found on the behavior

* PR feedback and lint fixes

* Additional PR feedback

* Cleanup

Co-authored-by: Eric Anderson <eanders@microsoft.com>

* Support conditional request headers for static files (#563)

* Support conditional request headers for static files

* Specify index explicitly

* Move restify types to types folder

* Fix conditional request for buffers

* Change missing buffer error from 500 to 404

* Move dependency to sdk package

* Version bump: 0.18.0

* Publish

 - @microsoft/mixed-reality-extension-altspacevr-extras@0.18.0
 - @microsoft/mixed-reality-extension-common@0.18.0
 - functional-tests@0.18.0
 - @microsoft/gltf-gen@0.18.0
 - @microsoft/mixed-reality-extension-sdk@0.18.0

* Automated: Regenerated documentation for 0.18.0

* Automated: Updated package-lock.json files for 0.18.0

* Add test cases with a pile composed of bodies from different clients

* Local vs Remote rigid body stack

* Update the 2 test that will be later potentially removed

* Remove obsolete test cases

Co-authored-by: Steven Vergenz <steven.vergenz@microsoft.com>
Co-authored-by: Eric Anderson <eanders@microsoft.com>
Co-authored-by: Kai <norybiak@gmail.com>
Co-authored-by: Tom Burdak <40439150+tombuMS@users.noreply.github.com>
Co-authored-by: Nikola Nikolic (HAVOK) <niknik@microsoft.com>

* Use blob to synchronize physics transforms (#594)

* Jabenk/mouse pick (#596)

* Transmit motion type also along the transforms

* Make boxes grabble in the pile test

* PR fixes (#598)

* Jabenk/mouse pick (#599)

* Transmit motion type also along with the transforms

* Make boxes grabble in the pile test

* Make the bodies from other tests grabbable

* Sleeping bodies message update

* server upload transform currend dev state

* update

* Physics bridge server transform upload channel

* physics bridge upload transforms

* physics bridge: working client transform upload stream

* minor polishing

* undo one comment change

* undo more

* remove compile warning

Co-authored-by: Nikola Nikolic <n.nikolic@outlook.com>
Co-authored-by: Steven Vergenz <steven.vergenz@microsoft.com>
Co-authored-by: Eric Anderson <eanders@microsoft.com>
Co-authored-by: Kai <norybiak@gmail.com>
Co-authored-by: Tom Burdak <40439150+tombuMS@users.noreply.github.com>
Co-authored-by: Nikola Nikolic (HAVOK) <niknik@microsoft.com>
  • Loading branch information
7 people authored Jul 1, 2020
1 parent 1a9ee04 commit f90d38b
Show file tree
Hide file tree
Showing 7 changed files with 91 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,6 @@ import * as MRE from '@microsoft/mixed-reality-extension-sdk';

import { App } from '../app';
import { Test } from '../test';
import { Vector3, Actor } from '@microsoft/mixed-reality-extension-sdk';
import { int } from '../../../common/src/math/types';

export default class PhysicsDynamicVsKinematicTest extends Test {

Expand Down
13 changes: 13 additions & 0 deletions packages/sdk/src/actor/physics/physicsBridge.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
*/

import { Guid } from "../../util";
import { TransformLike } from "..";

export type PhysicsBridgeTransformUpdate = {
id: Guid;
Expand All @@ -12,3 +13,15 @@ export type PhysicsBridgeTransformUpdate = {
flags: number;
transformsBlob: string;
}

export type PhysicsServerOneTransformsUpdate = {
localTransform: TransformLike;
appTransform: TransformLike;
actorGuid: Guid;
}

export type PhysicsUploadServerTransformsUpdate = {
id: Guid;
transformCount: number;
updates: PhysicsServerOneTransformsUpdate[];
}
9 changes: 8 additions & 1 deletion packages/sdk/src/core/contextInternal.ts
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ import {
Payloads,
Protocols,
} from '../internal';
import { PhysicsBridgeTransformUpdate } from '../actor/physics/physicsBridge';
import { PhysicsBridgeTransformUpdate, PhysicsUploadServerTransformsUpdate } from '../actor/physics/physicsBridge';

/**
* @hidden
Expand Down Expand Up @@ -290,6 +290,8 @@ export class ContextInternal {
execution.on('protocol.update-user', this.updateUser.bind(this));
execution.on('protocol.perform-action', this.performAction.bind(this));
execution.on('protocol.physicsbridge-update-transforms', this.updatePhysicsBridgeTransforms.bind(this));
execution.on('protocol.physicsbridge-server-transforms-upload',
this.updatePhysicsServerTransformsUpload.bind(this));
execution.on('protocol.receive-rpc', this.receiveRPC.bind(this));
execution.on('protocol.collision-event-raised', this.collisionEventRaised.bind(this));
execution.on('protocol.trigger-event-raised', this.triggerEventRaised.bind(this));
Expand Down Expand Up @@ -437,6 +439,11 @@ export class ContextInternal {
this.context.emitter.emit('physicsbridge-transforms-update', transforms);
}

public updatePhysicsServerTransformsUpload(transforms: Partial<PhysicsUploadServerTransformsUpdate>){
if (!transforms) { return; }
this.context.emitter.emit('physicsbridge-server-transforms-upload', transforms);
}

public updateAnimations(animPatches: Array<Partial<AnimationLike>>) {
if (!animPatches) { return; }
const newAnims: Animation[] = [];
Expand Down
56 changes: 56 additions & 0 deletions packages/sdk/src/internal/adapters/multipeer/rules.ts
Original file line number Diff line number Diff line change
Expand Up @@ -823,6 +823,62 @@ export const Rules: { [id in Payloads.PayloadType]: Rule } = {
}
},

// ========================================================================
'physicsbridge-server-transforms-upload': {
...DefaultRule,
synchronization: {
stage: 'always',
before: 'ignore',
during: 'queue',
after: 'allow'
},
client: {
...DefaultRule.client,
beforeQueueMessageForClient: (
session: Session,
client: Client,
message: Message<Payloads.PhysicsUploadServerUpdate>,
promise: ExportedPromise
) => {

return message;
},
shouldSendToUser: (message: Message<Payloads.PhysicsUploadServerUpdate>, userId, session, client) => {
// this is just upload do not sending anything to clients
return false;
}
},
session: {
...DefaultRule.session,
beforeReceiveFromApp: (
session: Session,
message: Message<Payloads.PhysicsUploadServerUpdate>
) => {

return message;
},
beforeReceiveFromClient: (
session: Session,
client: Client,
message: Message<Payloads.PhysicsUploadServerUpdate>
) => {
// update directly the transforms
for (const entry of message.payload.physicsTranformServer.updates) {
const syncActor = session.actorSet.get(entry.actorGuid);
if (syncActor) {
syncActor.initialization.message.payload.actor.transform.app = entry.appTransform;
syncActor.initialization.message.payload.actor.transform.local.position =
entry.localTransform.position;
syncActor.initialization.message.payload.actor.transform.local.rotation =
entry.localTransform.rotation;
}
}

return message;
}
}
},

// ========================================================================
'rigidbody-add-force': {
...DefaultRule,
Expand Down
1 change: 1 addition & 0 deletions packages/sdk/src/internal/payloads/payloads.ts
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@ export type PayloadType
| 'operation-result'
| 'perform-action'
| 'physicsbridge-transforms-update'
| 'physicsbridge-server-transforms-upload'
| 'rigidbody-add-force'
| 'rigidbody-add-force-at-position'
| 'rigidbody-add-relative-torque'
Expand Down
10 changes: 8 additions & 2 deletions packages/sdk/src/internal/payloads/physics.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,8 @@ import {
Vector3Like
} from '../..';
import {
PhysicsBridgeTransformUpdate
PhysicsBridgeTransformUpdate,
PhysicsUploadServerTransformsUpdate
} from '../../actor/physics/physicsBridge';

/**
Expand Down Expand Up @@ -106,4 +107,9 @@ export type TriggerEventRaised = Payloads.Payload & {
export type PhysicsBridgeUpdate = Payloads.Payload & {
type: 'physicsbridge-transforms-update';
transforms: Partial<PhysicsBridgeTransformUpdate>;
}
};

export type PhysicsUploadServerUpdate = Payloads.Payload & {
type: 'physicsbridge-server-transforms-upload';
physicsTranformServer: Partial<PhysicsUploadServerTransformsUpdate>;
};
5 changes: 5 additions & 0 deletions packages/sdk/src/internal/protocols/execution.ts
Original file line number Diff line number Diff line change
Expand Up @@ -121,6 +121,11 @@ export class Execution extends Protocol {
this.emit('protocol.physicsbridge-update-transforms', [payload.transforms]);
};

/** @private */
public 'recv-physicsbridge-server-transforms-upload' = (payload: Payloads.PhysicsUploadServerUpdate) => {
this.emit('protocol.physicsbridge-server-transforms-upload', [payload.physicsTranformServer]);
};

/** @private */
public 'recv-collision-event-raised' = (payload: Payloads.CollisionEventRaised) => {
this.emit('protocol.collision-event-raised', {
Expand Down

0 comments on commit f90d38b

Please sign in to comment.