The sources I’m using are from:
https://github.com/away3d/awayphysics-core-fp11
Thanks
]]>thanks again
]]>So I’m using Away 3D 4.1.6 and Away Physics to create a dice roll off a back wall of a large box/basin shape. I’ve been able to create a lovely natural looking roll. What I’m struggling with is finding which face is face up after it has stopped rolling.
I’ve seen the jiglib tutorial here
which has a supposed solution in it’s comments but this is no help since jiglib has not been updated to work with Away 3D 4.1.6 only the original Away 3D 4 before the way the primitives creation was changed and I need it use the most recent version.
I’ve also seen this function below on many a page here but it’s not accurate as you can have more than one vector at above 0.5 at times, meaning it gives which ever one was called first and not necessarily the right one. I did try to modify it to make it more accurate but still ended up with something inaccurate.
if (Math.abs (diceRb.up.y) >0.5)
{
if (diceRb.up.y > 0)
{
rollResult = 1;
}
else
{
rollResult = 6;
}
}
if (Math.abs (diceRb.front.y) >0.5)
{
if (diceRb.front.y > 0)
{
rollResult = 3;
}
else
{
rollResult = 4;
}
}
if (Math.abs (diceRb.right.y) >0.5)
{
if (diceRb.right.y > 0)
{
rollResult = 5;
}
else
{
rollResult = 2;
}
}
I’ve also tried to use rays on each side of my cube and try to detect whether they are intersecting with the floor object once it has stopped but I get the result that they all are so I must be doing something incorrectly when checking intersection.
Surely someone has figured this out? But it seems to be a common question and no obvious solution shown. Accuracy is of high importance here. Does anyone have any ideas about this in the current version of Away 3D and Away Physics. Anything I have found has related to older versions. Also given that there is no documentation for the physics part this is getting kinda difficult.
I feel there should be a simple enough solution and I should be able to use the up/right/front vector to get the correct face but I’ve found no method that is 100% accurate. If anyone can point me in a better direction please say. I’ve studied the tutorials but none have them really have enough information in them that match what I wish to do.
]]>
What would be the best way to create kinematic objects and how to get rid of all the jiggling and penetration errors?
I think this is a must have feature.
I also noticed that with CF_KINEMATIC_OBJECT object can’t be positioned - it just sits at 0,0,0.
I am working on a multiplayer game server that has to support players in different game levels at the same time. I want to isolate physics of each level from the others. All I need from AWP is collision detection.
I see there is a Singleton holding the AWPDynamicsWorld, perhaps it looks like there can be only one. Maybe instantiating many AWPCollisionWorld could work? Any idea on the subject? Thanks in advance
]]>