Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Replaces Raceway scene with one that opens in the SDK. Deleted redund… #308

Merged
merged 15 commits into from
Oct 7, 2022
Merged
Show file tree
Hide file tree
Changes from 14 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Binary file not shown.
Binary file not shown.
Binary file modified jme3-vehicle-creator/src/Models/Racetrack/Raceway.j3o
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Original file line number Diff line number Diff line change
Expand Up @@ -77,10 +77,13 @@ public VehicleEditorController(JmeSpatial jmeRootNode, BinaryModelDataObject cur
result.addLookupListener(this);
toolsNode.addLight(new DirectionalLight());
Node track = (Node) new DesktopAssetManager(true).loadModel("Models/Racetrack/Raceway.j3o");
track.getChild("Grass").getControl(RigidBodyControl.class).setPhysicsLocation(new Vector3f(30, -1, 0));
track.getChild("Grass").getControl(RigidBodyControl.class).setPhysicsRotation(new Quaternion().fromAngleAxis(FastMath.HALF_PI * 0.68f, Vector3f.UNIT_Y).toRotationMatrix());
track.getChild("Road").getControl(RigidBodyControl.class).setPhysicsLocation(new Vector3f(30, 0, 0));
track.getChild("Road").getControl(RigidBodyControl.class).setPhysicsRotation(new Quaternion().fromAngleAxis(FastMath.HALF_PI * 0.68f, Vector3f.UNIT_Y).toRotationMatrix());
if(track.getChild("Grass").getControl(RigidBodyControl.class) == null){
track.getChild("Grass").addControl(new RigidBodyControl());
track.getChild("Road").addControl(new RigidBodyControl());
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not sure if we'd want individual if's here? Though that would look ugly and be broken use-cases, I guess.
If we know that the Raceway.j3o doesn't have any RBCs at all anymore (which is very likely, considering we don't have them in blender and probably it would need a gltf extension anyway), we can probably also remove the if clause.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

But I've added them manually to the j3o. So in that case the whole clause could be removed. Or should I remove them from the j3o and generate every time?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh. I mean if they'd be dynamically generated, then we'd probably get rid of the problem that caused #278.
Otherwise, we may have another breakage when/if physics is changing again.

I guess both ways are fine for now though, especially since you already had the work to add it as well.
Do you see any downsides with code adding them though? any tweeks?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If we're to keep the lines generating the RBC's (and keep the j3o with the RBC's) I think it would also be better to do a check first. Or how would it handle generating a new control if there already is one?

track.getChild("Wall").addControl(new RigidBodyControl());
track.getChild("Rumble-Strip").addControl(new RigidBodyControl());
}

toolsNode.attachChild(track);
bulletState = new BulletAppState();

Expand Down