DirectX 9 with Bullet compile error

Post Reply
Anddos
Posts: 5
Joined: Wed Jun 30, 2010 2:18 am

DirectX 9 with Bullet compile error

Post by Anddos »

I am getting this error on some source code i found

1>BulletRigidBodies.cpp(427): warning C4800: 'bool *' : forcing value to bool 'true' or 'false' (performance warning)
1>BulletRigidBodies.cpp(761): error C2440: 'initializing' : cannot convert from 'const btRigidBody *' to 'btRigidBody *'
1> Conversion loses qualifiers
1> Generating Code...
1>
1>Build FAILED.
1>
1>Time Elapsed 00:00:08.30
========== Rebuild All: 0 succeeded, 1 failed, 0 skipped ==========

This is the source code part it errors on

Code: Select all

if( bRightButtonDown && mJediMode )
		{
			// Fire
			btRigidBody *pBody = NULL;

			btVector3 pos = ConvertVector(mCamera.GetEyePt());			

			btCollisionWorld::ClosestRayResultCallback rayCallback(pos,rayTo);
			mDynamicsWorld->rayTest(pos, rayTo, rayCallback);
			if (rayCallback.hasHit())
			{
				btRigidBody* body = btRigidBody::upcast(rayCallback.m_collisionObject);

				// Other exclusions?
				if ( body && !(body->isStaticObject() || body->isKinematicObject()) )
				{	
					// Move ghost object to world space clicked by user
					btTransform trn = mGhostObject->getWorldTransform();					
					trn.setOrigin(rayCallback.m_hitPointWorld);
					mGhostObject->setWorldTransform(trn);															
				}
			}
		}
Thanks if you can help
Attachments
BulletRigidBodies.zip
DirectX 9 with Bullet full source code
(986.7 KiB) Downloaded 149 times
c6burns
Posts: 149
Joined: Fri May 24, 2013 6:08 am

Re: DirectX 9 with Bullet compile error

Post by c6burns »

Use a const_cast ?
Post Reply