Hi !
Featured games (91)
games approved by the League of Dukes
Games in Showcase (756)
Games in Android Showcase (229)
games submitted by our members
Games in WIP (842)
games currently in development
News: Read the Java Gaming Resources, or peek at the official Java tutorials
    Home     Help   Search   Login   Register   
Pages: [1]
  ignore  |  Print  
  Character_Object..Is it possibble to initialize with no acting forces at all  (Read 1515 times)
0 Members and 1 Guest are viewing this topic.
Offline lukethor

Innocent Bystander

« Posted 2012-02-28 14:57:39 »

I am working on a game that introduces a Jbullet Character_object every certain amount of time into the physics world. The physics world only contain Static_Objects besides the character objects being introduced. Here are the two game states.

Stable state - I introduce only one Character_object into the system every 10 seconds , the game does not slow down the frames per second at all.

Unstable system
- Enter a Character_object every three seconds. The games becomes slow and the FPS slow down  from 60 FPS  to 8 FPS. The system never recovers again.

The desired system is to be able to enter into the physics world a character_object every three seconds. Is there any way to enter into the world a character_object that does not introduce any force at all while the velocity of the object falls to a certain threshold ?

Here are the constructors for the Character_Object and the Static_object :

   public Character(String name, String filepath,Vector3 pos) {

      //Get box dimensions from libgdx
      Vector3 boxDims = box.getDimensions();
      //Character shape, so construct the half extents and convert to JBullet's Vector type
      Vector3f halfExtents = new Vector3f(boxDims.x/2,
      CylinderShape shape = new CylinderShape(halfExtents);
      rigidBody = Physics.constructRigidBody(shape,
                // Just bouncy
      rigidBody.setCollisionFlags( rigidBody.getCollisionFlags() | CollisionFlags.CHARACTER_OBJECT);

public StaticMeshObject(String name, String filepath,Vector3 pos) {
      meshInterface = new TriangleIndexVertexArray();      
      trimesh = new IndexedMesh();
      BvhTriangleMeshShape meshShape = new BvhTriangleMeshShape(meshInterface, true, true)
      rigidBody = Physics.constructRigidBody(meshShape,
      rigidBody.setCollisionFlags(rigidBody.getCollisionFlags() | CollisionFlags.STATIC_OBJECT);
Pages: [1]
  ignore  |  Print  

DesertCoockie (54 views)
2018-05-13 18:23:11

nelsongames (86 views)
2018-04-24 18:15:36

nelsongames (76 views)
2018-04-24 18:14:32

ivj94 (761 views)
2018-03-24 14:47:39

ivj94 (93 views)
2018-03-24 14:46:31

ivj94 (645 views)
2018-03-24 14:43:53

Solater (106 views)
2018-03-17 05:04:08

nelsongames (187 views)
2018-03-05 17:56:34

Gornova (428 views)
2018-03-02 22:15:33

buddyBro (1088 views)
2018-02-28 16:59:18
Java Gaming Resources
by philfrei
2017-12-05 19:38:37

Java Gaming Resources
by philfrei
2017-12-05 19:37:39

Java Gaming Resources
by philfrei
2017-12-05 19:36:10

Java Gaming Resources
by philfrei
2017-12-05 19:33:10

List of Learning Resources
by elect
2017-03-13 14:05:44

List of Learning Resources
by elect
2017-03-13 14:04:45

SF/X Libraries
by philfrei
2017-03-02 08:45:19

SF/X Libraries
by philfrei
2017-03-02 08:44:05 is not responsible for the content posted by its members, including references to external websites, and other references that may or may not have a relation with our primarily gaming and game production oriented community. inquiries and complaints can be sent via email to the info‑account of the company managing the website of java‑
Powered by MySQL Powered by PHP Powered by SMF 1.1.18 | SMF © 2013, Simple Machines | Managed by Enhanced Four Valid XHTML 1.0! Valid CSS!