File tree Expand file tree Collapse file tree
MinieExamples/src/main/java/jme3test/batching Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -229,7 +229,7 @@ private void addBrick(Vector3f ori) {
229229 .setLinearSleepingThreshold (0f );
230230
231231 batchNode .attachChild (brickGeometry );
232- getPhysicsSpace (). add ( brickGeometry );
232+ brickGeometry . getControl ( RigidBodyControl . class ). setPhysicsSpace ( getPhysicsSpace () );
233233 }
234234
235235 private PhysicsSpace getPhysicsSpace () {
@@ -246,7 +246,7 @@ private void initFloor() {
246246 floor .setShadowMode (RenderQueue .ShadowMode .Receive );
247247 floor .addControl (new RigidBodyControl (PhysicsBody .massForStatic ));
248248 rootNode .attachChild (floor );
249- getPhysicsSpace (). add ( floor );
249+ floor . getControl ( RigidBodyControl . class ). setPhysicsSpace ( getPhysicsSpace () );
250250 }
251251
252252 private void initMaterial () {
@@ -317,7 +317,7 @@ private void shoot() {
317317 bulletNode .setLinearVelocity (cam .getDirection ().mult (25f ));
318318 geometry .addControl (bulletNode );
319319 rootNode .attachChild (geometry );
320- getPhysicsSpace (). add ( bulletNode );
320+ bulletNode . setPhysicsSpace ( getPhysicsSpace ());
321321
322322 System .out .println ("shoot" );
323323 }
You can’t perform that action at this time.
0 commit comments