_SIO2vertexgroup?
3 posters
_SIO2vertexgroup?
I have a stupid question. What is SIO2object->_SIO2vertexgroup and why itīs not duplicated when you use sio2ObjectDuplicate?
Thanks in advance.
Note: vbo and vbo_offset arenīt duplicated neither.
Thanks in advance.
Note: vbo and vbo_offset arenīt duplicated neither.
Re: _SIO2vertexgroup?
An object can have one to many vertex groups. Vertex groups contain the geometry (i.e. vertices and indices) of your mesh along with a material per group. If you duplicate an object, there's no need to duplicate the geometry as well, so the two objects share the data. Only attributes like transformation are required per object.
Best,
Matt
Best,
Matt
Re: _SIO2vertexgroup?
I'm having trouble getting sio2ObjectDuplicate to work.
Do I need to assign a vertex group and material to an object created with this function?
When I call it, and then call sio2ObjectRender on the new object, nothing seems to be rendered.
Thanks!!!
-joshua
Do I need to assign a vertex group and material to an object created with this function?
When I call it, and then call sio2ObjectRender on the new object, nothing seems to be rendered.
Thanks!!!
-joshua
meteors- Posts : 241
Join date : 2008-11-08
Location : Sunny Florida
Re: _SIO2vertexgroup?
Ok, I figured out how to display the duplicates by doing this:
mini_1->pos->x = 0.0;
mini_1->pos->y = 0.0;
mini_1->pos->z = 0.0;
sio2ObjectBindMatrix( mini_1 );
Sorry if this is a stupid question, but why does the duplicate not copy the same position as the original?
Best,
-joshua
PS - COME INTO THE IRC CHANNEL!!!
mini_1->pos->x = 0.0;
mini_1->pos->y = 0.0;
mini_1->pos->z = 0.0;
sio2ObjectBindMatrix( mini_1 );
Sorry if this is a stupid question, but why does the duplicate not copy the same position as the original?
Best,
-joshua
PS - COME INTO THE IRC CHANNEL!!!
meteors- Posts : 241
Join date : 2008-11-08
Location : Sunny Florida
Re: _SIO2vertexgroup?
It does. A good idea to figure out things is to look at the code:meteors wrote:Sorry if this is a stupid question, but why does the duplicate not copy the same position as the original?
- Code:
SIO2object *sio2ObjectDuplicate( SIO2object *_SIO2object,
char *_name )
{
SIO2object *dup = sio2ObjectInit( _name );
memcpy( dup->pos, _SIO2object->pos, 12 ); // Position is copied here
You probably didn't recognize any difference because the duplicate was rendered on the original.
Best,
Matt
Re: _SIO2vertexgroup?
My problem is with collision detection. Some duplicated objects doesn't detect collisions. I follow the process as described in the forum. I'm still trying to figure out what's happening.
Re: _SIO2vertexgroup?
What is the best practice for duplicating an SIOvertexgroup when duplicating an object?
I want my duplicate objects to be sovereign, deep copies.
Thanks!!
-joshua
I want my duplicate objects to be sovereign, deep copies.
Thanks!!
-joshua
meteors- Posts : 241
Join date : 2008-11-08
Location : Sunny Florida
Re: _SIO2vertexgroup?
Iīve found the source of my problem, but not the solution.
Some duplicated objects (set to ACTIVE_TAG when I create it) changes to status DISABLE_SIMULATION in a random point of the execution. Iīve traced the code and found the point where status is changed, in Bulletīs btCollisionWorld::updateAabbs():
Iīm looking for memory leaks in my code that could cause a problem but any help will be much appreciated, Iīm stuck in this problem some days and canīt get it
Some duplicated objects (set to ACTIVE_TAG when I create it) changes to status DISABLE_SIMULATION in a random point of the execution. Iīve traced the code and found the point where status is changed, in Bulletīs btCollisionWorld::updateAabbs():
- Code:
BT_PROFILE("updateAabbs");
btTransform predictedTrans;
for ( int i=0;i<m_collisionObjects.size();i++)
{
btCollisionObject* colObj = m_collisionObjects[i];
//only update aabb of active objects
if (colObj->isActive())
{
btVector3 minAabb,maxAabb;
colObj->getCollisionShape()->getAabb(colObj->getWorldTransform(), minAabb,maxAabb);
//need to increase the aabb for contact thresholds
btVector3 contactThreshold(gContactBreakingThreshold,gContactBreakingThreshold,gContactBreakingThreshold);
minAabb -= contactThreshold;
maxAabb += contactThreshold;
btBroadphaseInterface* bp = (btBroadphaseInterface*)m_broadphasePairCache;
//moving objects should be moderately sized, probably something wrong if not
if ( colObj->isStaticObject() || ((maxAabb-minAabb).length2() < btScalar(1e12)))
{
bp->setAabb(colObj->getBroadphaseHandle(),minAabb,maxAabb, m_dispatcher1);
} else
{
//something went wrong, investigate
//this assert is unwanted in 3D modelers (danger of loosing work)
colObj->setActivationState(DISABLE_SIMULATION); <- This is the place
static bool reportMe = true;
if (reportMe && m_debugDrawer)
{
reportMe = false;
m_debugDrawer->reportErrorWarning("Overflow in AABB, object removed from simulation");
m_debugDrawer->reportErrorWarning("If you can reproduce this, please email bugs@continuousphysics.com\n");
m_debugDrawer->reportErrorWarning("Please include above information, your Platform, version of OS.\n");
m_debugDrawer->reportErrorWarning("Thanks.\n");
}
}
}
}
Iīm looking for memory leaks in my code that could cause a problem but any help will be much appreciated, Iīm stuck in this problem some days and canīt get it
Permissions in this forum:
You cannot reply to topics in this forum