Jump to content

  • Log In with Google      Sign In   
  • Create Account


#ActualNyssa

Posted 03 February 2013 - 03:24 AM

In my opinion it would be best to have all scene objects capable of being a parent and to hold children. It will just make object handling a little easier. Something like the following maybe?

class SceneNode
{
	std::list<SceneNode*> children;
	
	/*Add methods here for adding and removing scene 
	nodes and any other common node methods too*/
};

class Bus : public SceneNode
{
	/*Bus related methods*/
};

class Character : public SceneNode
{
	/*Character related methods*/
};

 

As for physics, you mentioned Bullet...It holds it's own scene structure and feeds your scene objects with updated transforms. So it basically runs independently to your scene graph and you'd be using Bullets interface to move objects around. To create rigid bodies you feed Bullet with raw geometry (or use simple primitives) and positional data. You'd then tell Bullet what rigid bodies are attached to each other (parent/child relationships).

 
Note: I don't need really advanced physics simulations, just rigid body and collision.

Unfortunately once you start colliding multiple objects together and want correct collision detection and response, it becomes rather tricky, and implementing your own solution basically ends in recreating the wheel so to speak. Bullet will only do what it needs to do in terms of calculations so you wont be loosing out by using it.


#1Nyssa

Posted 03 February 2013 - 03:22 AM

In my opinion it would be best to have all scene objects capable of being a parent and to hold children. It will just make object handling a little easier. Something like the following maybe?

class SceneNode
{
	std::list<SceneNode*> children;
	
	/*Add methods here for adding and removing scene 
	nodes and any other common node methods too*/
};

class Bus : public SceneNode
{
	/*Bus related methods*/
};

class Character : public SceneNode
{
	/*Character related methods*/
};

 

As for physics, you mentioned Bullet...It holds it's own scene structure and feeds your scene objects with updated transforms. So it basically runs independently to your scene graph and you'd be using Bullets interface to move objects around. To create rigid bodies you feed Bullet with raw geometry (or use simple primitives) and positional data. You'd then tell Bullet what rigid bodies are attached to each other (parent/child relationships).

 
Note: I don't need really advanced physics simulations, just rigid body and collision.

Unfortunately once you start colliding multiple objects together and what correct collision detection and response, it becomes rather tricky, and implementing your own solution basically ends in recreating the wheel so to speak. Bullet will only do what it needs to do in terms of calculations so you wont be loosing out by using it.


PARTNERS