warnings for solutions

warnings for solutions

whugang's picture

Hi everyone, I am new in Havok. I feel interest in coding with Havok SDK.

Recently, I want to simulate a brick made of numbers of tetrahedals, and using a ball to hit the ball, I want to get the

result of the shatter or broken scenes.

But I met some problems.

Warning: Constraint added between two colliding dymaic rigid bodies. Check your collison filter logic and setup.

My model was made up of tetrahedals, I added Hingle Constraint between every two neighbor tetrahedals.

So there maybe this kind of conditons: rigidA,rigidB,first time met rigidA, rigidA and rigidB neighbors,added the constraint; later,met rigidB, again added the constraint.

Does it the problem tha cause the waring ?

Thanks.

14 posts / 0 new
Last post
For more complete information about compiler optimizations, see our Optimization Notice.
sean.thurston's picture

Hi whugang,

having a bunch of constrained bodies coming into contact like that is not the best idea. It is going to get bad performance and it is going to become unstable very easily. If you want a single brick that breaks apart into a bunch of pieces, your best bet is the hkpBreakOffPartsUtil. It takes a single compound object and breaks it into its shape parts when a certain impulse strength is reached. This sounds like pretty much what you are looking for.

There is a good demo on using it called BreakOffPartsDemo. It should show you how to set the utility up and get you going. Let me know if you have any questions on this.

If you want to make a whole breakable scene. There is going to be some considerable work needed on the art side of the project. Your best bet for doing a whole scene is to use the hkpBreakOffPartsUtil for one hkpExtendedMeshShape that contains the breakable pieces for your entire scene. This will give you the best performance if you are able to do it.

Thanks,
Sean

Developer Support Engineer Havok www.havok.com
whugang's picture
Quoting - sean.thurston

Hi whugang,

having a bunch of constrained bodies coming into contact like that is not the best idea. It is going to get bad performance and it is going to become unstable very easily. If you want a single brick that breaks apart into a bunch of pieces, your best bet is the hkpBreakOffPartsUtil. It takes a single compound object and breaks it into its shape parts when a certain impulse strength is reached. This sounds like pretty much what you are looking for.

There is a good demo on using it called BreakOffPartsDemo. It should show you how to set the utility up and get you going. Let me know if you have any questions on this.

If you want to make a whole breakable scene. There is going to be some considerable work needed on the art side of the project. Your best bet for doing a whole scene is to use the hkpBreakOffPartsUtil for one hkpExtendedMeshShape that contains the breakable pieces for your entire scene. This will give you the best performance if you are able to do it.

Thanks,
Sean

Thanks Sean

I will learn that demo, kind for your suggestions.

I hope you could give me more suggestions in the future.

Another question, I see the Havok Destruction sections on the official site, but I found no tuitors to finish this kind of

work. My research is based on 3D model effects , so I focus on it.

Even using 3dMax with Havok plugin to finish a destructable object would be good.

Thanks best wishes.

whugang's picture

As sean suggested, I found the BreakOffPartsDemo, not long before, I learned the Destruct Part(Glass Broken Demos Controlled by keyboard).

But it does not help me a lot, for my object model was made of tetrahedals or 3ds max exported model, and at the same time, that sdk demo rendering framework looks so difficult for me as new in Havok.

Thanks all the same.

sean.thurston's picture

Hi whudang,

I decided to point you to the BreakOffPartsDemo and not the broken glass demo because it sounded like you were exporting from a modeler and had pre-fractured pieces. From the modeler, you export all the pieces as a listshape or hkpExtendedMeshShape and then use the hkpBreakOffPartsUtil at runtime to cause the fracturing. This way you can use your own 3ds Max pieces.

Havok Destruction is a new product for making breakable rigid bodies and other things. It is not offered through tryHavok.

Thanks,
Sean

Developer Support Engineer Havok www.havok.com
whugang's picture
Dear Sean, thanks for suggested the hkpBreakOffPartsUtil demo, I have made some change to fit my models. This is really good recently, now there was a little problem. In that demo, the hkpBreakOffPartsUtil constructor needed a hkpBreakOffPartsListener parameter, and the demo class inherited from the hkpBreakOffPartsListener , so it used the this pointer. Unfortunately, in the standalone demo framework, how can I use the listener parameter. That is a just interface, simplely new a that object was surely bad. Hope for solutions, thanks again for your help. I feel good in using Havok.
sean.thurston's picture

Hi whugang,

You are correct the demo does set itself as the listener, implementing the breakOffSubPart method. You should be able to implement your own hkpBreakOffPartsListener (or copy the one over from the demo and change it where necessary). Then you can create a new instance of the listener.

Hope that helps.

Cheers,
Sean

Developer Support Engineer Havok www.havok.com
whugang's picture
Hi Sean, I solved the Listener problem. Later, I try to change my model. First, I used two tetrahedals to act as in the demo did, it successed, I also tried the entire breakoffparts. But, when I used many tetraheals (186 in my model) to do the same things simplely, shapes[186], warnings and problems come: Warning: Cannot calculate mass propertices of a hkGeometry with zero volume. Waring:ComputeShapeVolumeMassPropertices on a shape with no volume. Assert: mass > 0 In the two tetrahedal test and in the sdk demo, no such warnings. And I used the ConvexVerticesShapes as the sdk snippets does. Hope for solutions. Thanks
sean.thurston's picture

Hi whugang,

Can you determine which convex shape is causing this warning? Is it possible that the shape actually doesn't have any volume?

This is not really related to the hkpBreakOffPartsUtil. It has to do with calculating the inertia tensor of one of your tetrahedral. Is it possible that you are passing in a tetrahedral as a plane and setting its m_radius to 0.0f? This is one possibility.

If it is possible to narrow down which shape is throwing the warning. What do the vertices look like?

Let me know how it goes.

Cheers,
Sean

Developer Support Engineer Havok www.havok.com
whugang's picture
thanks, we have met some network problem these days. I solve that problem, for I have forgotten to add the arry index, so the lattervertexs got all zero points. there was some other problem. the system seemed support max 256 breakable pieces, so if i use the entirebreak like API, there would be some sever warning. So, how to make a fast and high performance break rigid was still a chanllange for me. Hope to get more help from you, thanks again, Sean.
sean.thurston's picture

Hi whugang,

I'm glad that you were able to solve your earlier problem.

How many pieces are you trying to break your object into? Is this a dynamic object or a static object? Do you have two of your breakable bodies running into each other?

Doing tons of little pieces of an object is going to be costly. This is a hard problem for most everybody to solve. Some of what you do is going to depend on what your use-case is. You can try doing some replacement techniques. You can try removing debris objects from the world as you go.

Sorry I can't be more specific at this time.

Cheers,
Sean

Developer Support Engineer Havok www.havok.com
whugang's picture
thanks for your kind encouragement. my model includes more then two thousands of triangles, I do not intend to crack all pieces, but using some parts of triangles to make a small part, this small part present a rigidbody, after that, lots of rigidbodies made up the final model, so it could be cracked, but this seemed unreal. are there any other solutions ?
sean.thurston's picture

Hi whugang,

It probably won't look 100% real because you are not doing procedural fracturing (even that is probably not going to be perfectly real). You are creating a set of fixed piece geometries. It will look pretty good because only pieces that get hit should break off, but it is going to have the same size and shape pieces every time. The block will have the same overall fracture pattern every time.

In terms of performance, your best bet is to try to limit the number of pieces while still getting a pretty good look and feel to it. The pieces should be convex, concave pieces will hurt performance.

Say I have a normal size brick. When I hit that brick somewhere close to the center, I expect it to break into maybe 4 or 5 pieces. I don't expect the brick to shatter into a 1000 pieces. Those 4-5 pieces might have concave geometry, little grooves and bumps to make it look better, but the physic representations would be a convex rigid bodies. I wouldn't allow each of those pieces to break anymore.

This is of course going to be dependent on your use-case. You can have bodies fracture more if that is really what is required. The more bodies that you have in your broadphase, the higher the cost of certain operations is going to be.

I hope that helps.

Cheers,
Sean

Developer Support Engineer Havok www.havok.com
whugang's picture
thanks, we have the same idea on some points. I was trying to make the brick into some different size based piece, when cracked, those pieces would be shattered. So.... As to the rendering system, I will spent more time. thanks again.Sean

Login to leave a comment.