trueaxis.com Forum Index trueaxis.com
True Axis Physics SDK Forum
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

TA::CollisionObjectCachedPolyData::GetNewPolygon

 
This forum is locked: you cannot post, reply to, or edit topics.   This topic is locked: you cannot edit posts or make replies.    trueaxis.com Forum Index -> General Discussion
View previous topic :: View next topic  
Author Message
kas



Joined: 23 Sep 2006
Posts: 6

PostPosted: Mon Mar 12, 2007 6:50 pm    Post subject: TA::CollisionObjectCachedPolyData::GetNewPolygon Reply with quote

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
View user's profile Send private message
kas



Joined: 23 Sep 2006
Posts: 6

PostPosted: Fri Mar 16, 2007 5:59 pm    Post subject: up Reply with quote

is there any workaround that'l lallow me to use custom bbox vs terrain test proc?
Back to top
View user's profile Send private message
kas



Joined: 23 Sep 2006
Posts: 6

PostPosted: Sun Mar 25, 2007 8:41 am    Post subject: Reply with quote

up
Back to top
View user's profile Send private message
luke
Site Admin


Joined: 15 Oct 2004
Posts: 621

PostPosted: Mon Mar 26, 2007 10:49 am    Post subject: Reply with quote

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
View user's profile Send private message Send e-mail
kas



Joined: 23 Sep 2006
Posts: 6

PostPosted: Mon Mar 26, 2007 9:05 pm    Post subject: Reply with quote

thanks for workaround, seems like it'll work just fine
Back to top
View user's profile Send private message
kas



Joined: 23 Sep 2006
Posts: 6

PostPosted: Mon Apr 02, 2007 11:29 am    Post subject: Reply with quote

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
View user's profile Send private message
Display posts from previous:   
This forum is locked: you cannot post, reply to, or edit topics.   This topic is locked: you cannot edit posts or make replies.    trueaxis.com Forum Index -> General Discussion All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group