| View previous topic :: View next topic |
| Author |
Message |
kas
Joined: 23 Sep 2006 Posts: 6
|
Posted: Mon Mar 12, 2007 6:50 pm Post subject: TA::CollisionObjectCachedPolyData::GetNewPolygon |
|
|
| When calling TA::CollisionObjectCachedPolyData::GetNewPolygon in CachedLocalPolygons it returns Polygon object whos fields are uninitialized and subsequent call to Polygon::GetVertex result in assertion. Am i doing something wrong? |
|
| Back to top |
|
 |
kas
Joined: 23 Sep 2006 Posts: 6
|
Posted: Fri Mar 16, 2007 5:59 pm Post subject: up |
|
|
| is there any workaround that'l lallow me to use custom bbox vs terrain test proc? |
|
| Back to top |
|
 |
kas
Joined: 23 Sep 2006 Posts: 6
|
Posted: Sun Mar 25, 2007 8:41 am Post subject: |
|
|
| up |
|
| Back to top |
|
 |
luke Site Admin
Joined: 15 Oct 2004 Posts: 621
|
Posted: Mon Mar 26, 2007 10:49 am Post subject: |
|
|
This funciton is used internally in TrueAxis in a couple of places for complex collision meshes. This means the function should work.
Ok, actually, there is a bug in the function where the number of vericies is not set, causing the assert.
to work around, in the file "CollisionObjectCachedPolyData.h", you change the struct:
| Code: | struct Polygon
{
const Vec3& GetNormal();
void SetNormal(const Vec3& v3Normal);
int GetAttribute() const;
void SetAttribute(int nAttribute);
int GetNumVertices() const;
void SetCollisionID(u32 nCollisionID);
u32 GetCollisionID() const;
Vertex& GetVertex(int nIndex);
const Vertex& GetVertex(int nIndex) const;
void GenerateEdgeNormals();
#ifndef lOllOllOOlO
private:
#endif
Vec3 lOOOlOOOOO;
int llOlllOlOOO;
int lOllOlllOl;
u32 llOlllOlllO;
u32 lllOlOOlOOO;
Vertex llOllllOlO[lOlllOOlOll];
}; |
by adding the fuction:
| Code: | | void SetNumVertices(int nVertices) { lOllOlllOl = nVertices; } |
inside the body of the class.
Then you must set the number of vertices to the same number give ot the function GetNewPolygon |
|
| Back to top |
|
 |
kas
Joined: 23 Sep 2006 Posts: 6
|
Posted: Mon Mar 26, 2007 9:05 pm Post subject: |
|
|
| thanks for workaround, seems like it'll work just fine |
|
| Back to top |
|
 |
kas
Joined: 23 Sep 2006 Posts: 6
|
Posted: Mon Apr 02, 2007 11:29 am Post subject: |
|
|
| one more question. it turns out that TA::CollisionObjectCachedPolyData can allocate 64 polygons max, is there any way to increase it? thanks in advance |
|
| Back to top |
|
 |
|