Jump to content
  • entries
    945
  • comments
    5,899
  • views
    930,149

More Physics Phun


Josh

3,126 views

 Share

Physics works great with scaled entities: biggrin.png

blogentry-1-0-05421300-1341977605_thumb.png

 

For joints in the new engine, I am considering something fairly radical. In Leadwerks Engine 2, joints were just a class that wasn't an extension of the entity class. I was going to make a new Joint class that extends the Entity class. The problem is you would end up inserting a ton of intermediary joint entities into your model hierarchy, which would hurt the editor's ability to reload models on the fly.

 

What if joints were just a feature in the Entity class? You could set an entity's joint mode and that would create a joint between itself and its parent. You could go through the hierarchy of a character and easily set up ball and hinge joints within the model hierarchy to make a rag doll:

blogentry-1-0-42147800-1342030407_thumb.png

 

Of course this means no entity can be the child of two joints. Joint hierarchies would have to go one-way. For example, if you had a connection like this:

 

[Parent] - Joint - [Child] - Joint - [Parent]

 

It would have to be arranged like this instead:

 

[Parent] - Joint - [Child] - Joint - [Child of Child]

 

For example, in the picture below #1 is the top-level parent, and the children are numbered as they descend. If the blocks are each connected with joints, you will run into problems with the fifth level down, because you are trying to connect the child to two different parents:

blogentry-1-0-19510200-1342031660_thumb.png

 

Are people really going to be making suspension bridges that disconnect and reconnect multiple times? Not sure yet if this would pose a problem or not. However, it would be super convenient to be able to load up that buggy model and add joints to the wheels and turret, without having to create and position new joint entities. It totally eliminates the problem of having to figure out which entities are attached to which joint.

 

--EDIT--

Hmmmm, maybe this isn't such a hot idea. Here's a situation where the design would totally fail:

blogentry-1-0-01132700-1342037597_thumb.png

 

Since our physics are the only ones stable enough for robotics and scientific simulations, I think it needs to be able to accommodate complex machinery.

  • Upvote 1
 Share

4 Comments


Recommended Comments

what about setting the locations of the joints between the bodies... that's always been an issue determining if you have the joint/pin set in the location correctly... is there going to still be a visual aspect to this that lets us know where it is located at?

 

as for the parent-child-parent thing - a simple example would be newton's cradle. Would making the ball the parent instead of the two opposing strings still allow for this to work correctly? but then it gets to being a matter of making the stands that the strings are attached to separate pieces instead of one to allow for the parent-child relationship, i guess...

Link to comment
what about setting the locations of the joints between the bodies... that's always been an issue determining if you have the joint/pin set in the location correctly... is there going to still be a visual aspect to this that lets us know where it is located at?

I'm not dealing with that yet.

 

as for the parent-child-parent thing - a simple example would be newton's cradle. Would making the ball the parent instead of the two opposing strings still allow for this to work correctly? but then it gets to being a matter of making the stands that the strings are attached to separate pieces instead of one to allow for the parent-child relationship, i guess...

The way I would do it is make the frame the parent, then make the balls children, connected with one hinge each. Using two ball joints would not be anything close to an approximation of a string, because a string only exerts a force if the distance between two bodies goes beyond some distance. A ball joint will actually push connected bodies away if they are too close together.

Link to comment

Yeah, I think joints need to be a separate entity class. However, they will not use the entity parent and first child for the joint bodies, as I originally had thought they could. Thanks for the discussion.

Link to comment

Just wanted to say that I like that you're open to blogging about incomplete ideas Josh. Its fun to sometimes see such ideas, even if they are a dead end.

  • Upvote 1
Link to comment
Guest
Add a comment...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...