Deactive physics object

Is there a way to deactive a physics object. I see there is an activate() method for PhysicsRidgidBody class. I don’t want to use SetSleepThreshold()



Thank in advance

With your requirements of not using the sleep threshold I only see the option of setting it to kinematic mode temporarily or even removing it completely from the physics space.

[java]rigidbody.setEnabled(false);[/java]

@wezrule said:
[java]rigidbody.setEnabled(false);[/java]

...effectively removes the physics object from the physics space, yeah :)

SetSleepThreshold(some value so it will sleep instantly) when it should sleep

and reset that to normal values on activate

@EmpirePhoenix said:
SetSleepThreshold(some value so it will sleep instantly) when it should sleep
and reset that to normal values on activate

no-no-no! he doesn't want to use setSleepThreshold ;)

Actually whay not? funbox explain why .



(90% bet that its some user generated mid fuck )

This is what I am trying to do. I have a bunch of blocks that I linked up with physics. I would like to deactivate them when I first load them to save resources. As soon as I throw a ball at them they will become activated automatically by bullet detecting collisions (no programming on my end). I am developing this on the android and need to save as much resources as I can. I noticed when I load the scene it is slow around 20 fps. As soon as the blocks sleep around 1.5 seconds from when the scene is loaded things pick up to 60fps. I would like to load a scene where the blocks are already sleeping or deactivated.



If I use sleepthreshold then the blocks that are slowly falling of one another blocks will stop rotating in the air and sleep.



Thanks agian,

Ryan

just set the sleep threashold for 50ms low after scene startup, then set it to a normal value.



Your problem is, that there is no deactivate method in bullet.

(I guess it would be possible to write one that does what the sleepthreashold does to deaktivate however)