Jump to content
  • Advertisement

shashwatsher

Member
  • Content Count

    6
  • Joined

  • Last visited

Community Reputation

119 Neutral

About shashwatsher

  • Rank
    Newbie
  1. Hi guys   I am building a car game with help of bullet physics and need help regarding a specific functionality. I have attached a Canon to my car to shoot bullets. Actually my car body and the canon are two separate rigidbody objects attached using btHingeConstraint ( there is a reason why i have done that instead of using compoundshape). The canon is at right position and the shooting is also working perfectly.  The problem happens when my car collides with a building. At this moment my canon dislodges from the car. Is there a way I can make canon stiffly bound tho the car using hingeconstarint only? I read bout CFM and ERP but they prove to be of no use. Here is a sample code -                 btVector3 cyl_coord = btVector3(0.5, 1, 1);                 btCollisionShape* suppShape = new btCylinderShapeZ(cyl_coord); suppLocalTrans.setIdentity();                 suppLocalTrans.setOrigin(m_cameraPosition);                 m_canon = localCreateRigidBody(1,suppLocalTrans, suppShape); // Canon added to car                                  btTransform localC, localD; localC.setIdentity(); localD.setIdentity(); localC.getBasis().setEulerZYX(0, M_PI_2, 0); localC.setOrigin(btVector3(0.0, 0.2, 1.05)); localD.getBasis().setEulerZYX(0, M_PI_2, 0);                 localD.setOrigin(btVector3(0.0, -1.5, -1.05)); m_liftHinge = new btHingeConstraint(*m_carChassis,*m_canon, localC, localD);// Creating the constraint m_liftHinge->setLimit(0.0f, 0.0f);                 m_liftHinge->setParam( BT_CONSTRAINT_STOP_CFM, 0, -1); m_dynamicsWorld->addConstraint(m_liftHinge, true);   Can any one help with this.
  2. shashwatsher

    How to shoot using Bulllet Physics

    Thanks a lot Nypyren!!!... This is exactly ehat I was looking for
  3. shashwatsher

    How to shoot using Bulllet Physics

    Yes Aardvajk... That is what i intended to know. Even after spending a lot of time I was not able to exactly pin point the function call which facilitates this.
  4. shashwatsher

    How to shoot using Bulllet Physics

    I already have a working model for my tps and I didn't intend to ask on how to create boxes or sphere. I have read the documentation and do know how to do that. My question was more out of curiosity. All the demos have the functionality of shooting cubes on pressing dot(.) / right click. However none of the demos have the code defined for it. So I presume this is part of some standard functionality provided in some header file. All I wanted to know is the name of the header file. I am sorry if the question came up as half cooked or inspired by laziness. That was not the intention.
  5. shashwatsher

    How to shoot using Bulllet Physics

    Hi Alundra...thanks for the reply. However my question still remains standing. Which is the API call (and in which header file) where the code for creation of boxes is defined? What if I want to shoot spheres and not cubes??? Where in the code I can change it? What parameter I need to pass to facilitate this?
  6. I am a begginner with Bullet Physics and just exploring its features. One of the first things that caught my fancy is the ability to shoot boxes provided in all demos. I want to know through which function call or in which header file the functionality is described? Also is it possible to change the camera position of the strating point from where the boxes seem to emerge? What I mean is currently on pressing '.' the boxes seem to emerge from the viewer's camera position. I want to change it so that boxes seems to emerge from a particular point in the camera space. want to integrate this functionality with a third person shooter game I am developing. Kindly help!!!
  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!