At awayphyscis example ConvexHullShapeTest debugdraw not correct

Software: Away3D 4.x

rontian, Newbie
Posted: 29 November 2012 02:22 AM   Total Posts: 6

I use away3d v4.1 alpha and awayphysics v1.0
who knows how to fix it?

 

   

rontian, Newbie
Posted: 29 November 2012 06:13 AM   Total Posts: 6   [ # 1 ]

I viewed the model parser.
modify debugDraw drawTriangles function,now like correct.why?

for (var i:int 0indexDataLen+= {
    v0
.setTo(vertexData[13 indexData[m]] scale.xvertexData[13 indexData[m] 1] scale.yvertexData[13 indexData[m] 2] scale.z);
    
m++;
    
v1.setTo(vertexData[13*indexData[m]] scale.xvertexData[13*indexData[m]+1] scale.yvertexData[13*indexData[m]+2] scale.z);
    
m++;
    
v2.setTo(vertexData[13*indexData[m]] scale.xvertexData[13*indexData[m]+1] scale.yvertexData[13*indexData[m]+2] scale.z);
    
m++;
    
drawTriangle(transform.transform.transformVector(v0), transform.transform.transformVector(v1), transform.transform.transformVector(v2), color);
   
   

John Brookes, Moderator
Posted: 29 November 2012 12:07 PM   Total Posts: 732   [ # 2 ]

Make sure your using the lastest
AwayPhysics v1.0 alpha (13-11-2012)

   

Denis, Newbie
Posted: 24 January 2013 11:47 AM   Total Posts: 15   [ # 3 ]

Somebody solved this problem? I have this problem too. Where i can download lastest AwayPhysics?

   

ranoya, Newbie
Posted: 19 February 2013 10:49 PM   Total Posts: 29   [ # 4 ]

I have the same problem.

I think this is caused by an diferent extructure adopted by SubGeometry objects in the actual release of Away 4.1.

The AWPConvexHullShape constructor get the geometry.subGeometry[0].vertexData for construct the “physics triangle shape”. In version 4.0, this Vector had only vertex position data. The actual SubGeometry::vertexData carries normal, tangent and UV data, all in the same Vector (probably for performance optimization). But away 4.1 is Alpha, and the classes are instable…
But the first 4.1 aplha release didn´t have this issue, cause i´ve already used AWPConvexHullShape whith 4.1 and they worked well togheter.

May someone confirm this?

   

ranoya, Newbie
Posted: 20 February 2013 12:43 AM   Total Posts: 29   [ # 5 ]

I think I understood what is happening. Now there is a class, CompactSubGeometry, whose vertexData property is read by ConvexHullShape. This Vector has data that the ConvexHullShape class
doesn´t know how to manage. ConvexHullShape is waiting for 3 stride vertex data, and the CompactSubGeometry vertexData carries 13 stride data.

I change ConvexHullShape class constructor this way :

//var vertex Data : Vector.<Number> = geometry.subGeometries[0].vertexData;

var vData Vector.<Number> = geometry.subGeometries[0].vertexData;
var 
vertexData = new Vector.<Number>();
for (var 
int 0vData.lengthi+=13)
{
 vertexData
.push(vData[i]vData[i+1]vData[i+2]);

and the physics works OK. For the debugger to display the correct shape, you need to write a similar code in AWPDebugDraw class.

While the “official” solution doesn´t come, this is a provisional one.

 

   

Denis, Newbie
Posted: 20 February 2013 07:38 AM   Total Posts: 15   [ # 6 ]

Use this http://away3d.com/forum/viewthread/3887/

and use away3d 4.1

   

ranoya, Newbie
Posted: 20 February 2013 09:31 AM   Total Posts: 29   [ # 7 ]

I´m already using these versions and awayphysycs’ ConvexHullShape doesn´t work.

   

John Brookes, Moderator
Posted: 20 February 2013 12:22 PM   Total Posts: 732   [ # 8 ]

If your AWPConvexHullShape.as doesnt look like

https://github.com/away3d/awayphysics-core-fp11/blob/dev/AwayPhysics/src/awayphysics/collision/shapes/AWPConvexHullShape.as

Then you need to update to the DEV branch.

   

ranoya, Newbie
Posted: 20 February 2013 02:15 PM   Total Posts: 29   [ # 9 ]

JohnBrooks, you are right.

Thanks a lot;

   
   

X

Away3D Forum

Member Login

Username

Password

Remember_me



X