Commits

minz  committed 83c9b7b

new functions are banned because of unkown bugs.

  • Participants
  • Parent commits 2d92de3
  • Branches physics

Comments (0)

Files changed (4)

File src/pgCollision.c

 pgJointObject* PG_ContactNew(pgBodyObject* refBody, pgBodyObject* incidBody)
 {
 	pgContact* contact;
-	//TODO: this function would be changed
+	//TODO: this function would be replaced.
 	contact = (pgContact*)PyObject_MALLOC(sizeof(pgContact));
 	contact->joint.body1 = refBody;
 	contact->joint.body2 = incidBody;

File src/pgJointObject.c

 	0,                          /* tp_iter */
 	0,                          /* tp_iternext */
 	0,							/* tp_methods */
-	_pgDistanceJoint_members,							/* tp_members */
+	_pgDistanceJoint_members,	/* tp_members */
 	0,							/* tp_getset */
-	&pgJointType,                          /* tp_base */
+	&pgJointType,               /* tp_base */
 	0,                          /* tp_dict */
 	0,                          /* tp_descr_get */
 	0,                          /* tp_descr_set */
 	0,                          /* tp_dictoffset */
-	(initproc)_pgDistanceJoint_init,                          /* tp_init */
+	(initproc)_pgDistanceJoint_init,  /* tp_init */
 	0,                          /* tp_alloc */
 	0,							/* tp_new */
 	0,                          /* tp_free */

File src/pgShapeObject.c

 	PG_ShapeObjectInit(&(p->shape));
 	p->shape.Destroy = PG_RectShapeDestroy;
 	p->shape.UpdateAABB = PG_RectShapeUpdateAABB;
+	p->shape.Collision = PG_RectShapeCollision;
 	p->shape.type = ST_RECT;
 	p->shape.rInertia = body->fMass*(width*width + height*height)/12; // I = M(a^2 + b^2)/12
 

File src/pgWorldObject.c

 
 void _PG_BodyCollisionDetection(pgWorldObject* world)
 {
-	int i, j;
+	Py_ssize_t i, j;
 	pgBodyObject* refBody, *incBody;
-	int size = PyList_Size((PyObject*)(world->bodyList));
+	Py_ssize_t size = PyList_Size((PyObject*)(world->bodyList));
+	//TODO: clear contactList first
 	for(i = 0; i < size-1; ++i)
 	{
 		refBody = (pgBodyObject*)(PyList_GetItem((PyObject*)(world->bodyList), i));
 	int i;
 
 	_PG_FreeBodySimulation(world, stepTime);
-	_PG_BodyCollisionDetection(world);
+	//_PG_BodyCollisionDetection(world);
 	for (i = 0;i < MAX_SOLVE_INTERAT;i++)
 	{
 		_PG_JointSolve(world,stepTime);