Comments (1)
An actor needs to have an owner when using rigidBodies, otherwise the client side portion of the SDK will not add the actor to the physics bridge, or perform any action such as addForce().
I discovered that when actors are created immediately after the onStarted() event, the SDK fails to properly update each actor's owner once the authoritative user joins. The _rigidBodyDefaultOwner is still undefined at this point.
Actors with rigidBodies for physics simulation require a different method of instantiation than how the sample apps are doing it (e.g. creating actors after onStarted()). This isn't known since there is a lack of documentation on the matter.
The below is an example of a pattern that can be used to assist with getting around the issue mentioned above.
private actorsWithPhysicsCreated = false;
constructor(private context: MRE.Context)
{
this.context.onStarted(() => this.createStaticActors());
this.context.onUserJoined((user) => {
if (!actorsWithPhysicsCreated)
this.initActorsWithPhysics();
this.userJoined(user);
});
}
private createStaticActors() {
}
private initActorsWithPhysics() {
this.actorsWithPhysicsCreated = true;
}
private userJoined(use: MRE.User) {
}
For the SDK devs: A better pattern would be for the onStarted() event to fire once the authoritative user is known and the _rigidBodyDefaultOwner property has been defined.
If an actor is intended to be exclusive, it's best to set the the owner manually.
MRE.Actor.Create(this.app.context, {
actor: {
exclusiveToUser: user.id,
owner: user.id,
}
});
Edit:
"I discovered that when actors are created immediately after the onStarted() event, the SDK fails to properly update each actor's owner once the authoritative user joins. The _rigidBodyDefaultOwner is still undefined at this point."
I found a fix that ensures actors created without owners properly receive the default owner when created within this.context.onStarted(() => ...
. See the referenced PRs.
from mixed-reality-extension-sdk.
Related Issues (20)
- GPU Perf: Text mesh pro elements are not batching
- GPU Perf: reuse materials/textures across apps HOT 1
- GPU Perf: minimize drawcalls from identical materials with different colors. HOT 1
- Deleted animations cause exceptions when MRE is unloaded
- Changing an actor's parent immediately after creation results in unpredictable behavior HOT 1
- Vectors and Quaternions should be immutable
- It's difficult to adjust the app scale of an actor
- Object grab required for synchronization
- Updating actor transforms in a grab end callback has unpredictable results
- Creating an actor under a disabled parent results in unpredictable behavior
- Execute WebAssembly HOT 1
- Add functionality so animate can control media parameters
- ability to control shader parameters of existing object? (feature request) HOT 1
- Transform updates not propagating for attachments when using subscription 'transform' HOT 1
- Hello World sample doesn't work HOT 1
- VideoStream volume options stopped working HOT 2
- Feature-Request: Add Animator Controller support in SDK
- Changes in the code (MRE) are not reflected in Altspace VR HOT 1
- Live streaming not creating video streaming assets
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from mixed-reality-extension-sdk.