void PhysicsWorld::CreateCollisionBox(BoxInfo& info)
{
// Creates a Box Object.
btCollisionShape* colShape = new btBoxShape(info.halfscale);
collisionShapes.push_back(colShape);
btTransform startTransform;
startTransform.setIdentity();
btScalar mass=info.mass;
//rigidbody is dynamic if and only if mass is non zero, otherwise static
bool isDynamic = (mass != 0.f);
btVector3 localInertia=info.localInertia;
if (isDynamic)
colShape->calculateLocalInertia(mass,localInertia);
startTransform.setOrigin(info.orgin);
//using motionstate is recommended, it provides interpolation capabilities, and only synchronizes 'active' objects
btDefaultMotionState* myMotionState = new btDefaultMotionState(startTransform);
btRigidBody::btRigidBodyConstructionInfo rbInfo(mass,myMotionState,colShape,localInertia);
rbInfo.m_friction=info.friction;
rbInfo.m_restitution=info.restitution;
rbInfo.m_linearDamping=info.linearDamping;
rbInfo.m_angularDamping=info.angularDamping;
btRigidBody* body = new btRigidBody(rbInfo);
dynamicsWorld->addRigidBody(body);
}
and here is the error::
Unhandled exception at 0x004a69bd in MovingObjects.exe: 0xC0000005: Access violation reading location 0x5b845c33.
MovingObjects is our program
error line:
in btcollisionworld.cpp line 100
collisionObject->getCollisionShape()->getAabb(trans,minAabb,maxAabb);
This is the same exact function we used when it wokred fine but now in the line where we pass data into rbInfo things are not getting updated.
Right here ::
btRigidBody::btRigidBodyConstructionInfo rbInfo(mass,myMotionState,colShape,localInertia);
the colShape is passed as a box, and in our other function it is passed a sphere etc, (into rbInfo) however when we pass it through we debug and step into the function and the Info is not actually getting passed through but this data has the correct values before getting passed into rbInfo for example... for a sphere colShape has a value of 8 for sphere, but when we pass it into rbinfo it has a value of 8 but when we step into the function it shows it having a NULL value...

I dont get why it worked earlier i actually have both programs.. the working one in console, and then the broken one where things are not getting updated with the Direct X. I just dont see how direct x will have any difference into this function when direct x is just graphics and this function is nothing but position values.