Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

Dark Physics & Dark A.I. & Dark Dynamix / Dyn: Triangle Mesh Set Mass

Author
Message
DigitalFury
13
Years of Service
User Offline
Joined: 30th Jul 2010
Location: United States
Posted: 6th Jun 2012 09:16
For some reason the mass is still 0.0. I've played around with the code for an hour and i'm really stuck.

Here is the code I used:


To make it easy on myself I set the triangleMeshID to the same thing as the object ID. I got no errors and when I get the mass it is 0.0 for some reason.

I have no idea why I can't make it have mass.

Thanks for your help in advance,

DigitalFury

Get Out Alive (Zombie WIP): My latest zombie game I am working on.
Matty H
15
Years of Service
User Offline
Joined: 7th Oct 2008
Location: England
Posted: 6th Jun 2012 15:24
I don't think you can give a static actor mass, since it is static and does not move it can be seen to have infinite mass. If you want other things to react differently when colliding with it then it is the materials that need changing.

The command DYN UPDATE MASS FROM SHAPES is used to recalculate the centre of gravity if you manually move or rotate any shapes in an actor.

DigitalFury
13
Years of Service
User Offline
Joined: 30th Jul 2010
Location: United States
Posted: 6th Jun 2012 20:41
@Matty H - How can you make it dynamic then?

DigitalFury

Get Out Alive (Zombie WIP): My latest zombie game I am working on.
Matty H
15
Years of Service
User Offline
Joined: 7th Oct 2008
Location: England
Posted: 7th Jun 2012 12:35
Triangle meshes can only be static, same with height-fields. I think there was a point once when dynamic triangle meshes were supported but I think they were very slow and unreliable so they have been dropped.

Any complex dynamic object should be made from many simpler shapes(compound actor) or perhaps one 'best fit' convex mesh.

DigitalFury
13
Years of Service
User Offline
Joined: 30th Jul 2010
Location: United States
Posted: 7th Jun 2012 20:49 Edited at: 7th Jun 2012 21:01
@Matty H - Wouldn't that mean that you can use complicated meshes such as a complicated building with stairs and everything?

There may be no way around it. I realize they are slow but I might need that feature for my more complex objects to save me time from manually making physics boxes which could take forever.

DigitalFury

Get Out Alive (Zombie WIP): My latest zombie game I am working on.
Matty H
15
Years of Service
User Offline
Joined: 7th Oct 2008
Location: England
Posted: 7th Jun 2012 22:18
Triangle meshes are for level geometry like buildings with stairs etc.

What are you trying to create that is complex but needs to be dynamic?

One solution might be to create a convex mesh shape for each limb and then create a compound actor from these shapes, this depends on whether your object has limbs. A method similar to this can be used for characters to get better collision detection from raycasts etc.

DigitalFury
13
Years of Service
User Offline
Joined: 30th Jul 2010
Location: United States
Posted: 7th Jun 2012 22:52
@Matty H - I see your point. Convex meshes might be enough for dynamic objects I just don't know how much detail a convex mesh will cover. Some of my dynamic objects has holes in it that I would like to be shot though using a weapon.

I'll try convex meshes. Hopefully that will be enough.

Thanks for your help,

DigitalFury

Get Out Alive (Zombie WIP): My latest zombie game I am working on.

Login to post a reply

Server time is: 2024-03-28 23:09:33
Your offset time is: 2024-03-28 23:09:33