Laurens Posted January 11, 2010 Share Posted January 11, 2010 Hello, I have continued experimenting with my input handling but now have trouble getting physics to work. My ball (Pong) is initialized like so: Ball::Ball() { ball = LoadModel("abstract::ball.gmf"); EntityType(ball, 1); SetBodyMass(ball, 1.0f); } After the ball is initialized, Collisions(1, 1, 1) is called. This is the Update method of the ball class: void Ball::Update() { AddBodyForce(ball, Vec3(1.0f, 0.0f, 0.0f)); } Setting a breakpoint confirmed it is getting called, yet the ball won't move a bit. If I call DebugPhysics(1) it does show a proper collision hull yet the hull remains red. Anyone know what I am missing here? Quote Link to comment Share on other sites More sharing options...
Niosop Posted January 11, 2010 Share Posted January 11, 2010 Did you create a .phy file for it or did you let it autocreate one? The one it autocreates from the mesh is a static body, I don't think you can move it. 1 Quote Windows 7 x64 - Q6700 @ 2.66GHz - 4GB RAM - 8800 GTX ZBrush - Blender Link to comment Share on other sites More sharing options...
Marleys Ghost Posted January 11, 2010 Share Posted January 11, 2010 normally issues I have like that have been .phy file related Laurens. 1 Quote AMD Bulldozer FX-4 Quad Core 4100 Black Edition 2 x 4GB DDR3 1333Mhz Memory Gigabyte GeForce GTX 550 Ti OC 1024MB GDDR5 Windows 7 Home 64 bit BlitzMax 1.50 • Lua 5.1 • MaxGUI 1.41 • UU3D Pro • MessiahStudio Pro • Silo Pro 3D Coat • ShaderMap Pro • Hexagon 2 • Photoshop, Gimp & Paint.NET LE 2.5/3.4 • Skyline • UE4 • CE3 SDK • Unity 5 • Esenthel Engine 2.0 Marleys Ghost's YouTube Channel • Marleys Ghost's Blog "I used to be alive like you .... then I took an arrow to the head" Link to comment Share on other sites More sharing options...
Laurens Posted January 11, 2010 Author Share Posted January 11, 2010 I had it auto-create one, it's working now. Thanks a bunch Good to know you can't use those though. /me slaps himself in the face. Quote Link to comment Share on other sites More sharing options...
Laurens Posted January 11, 2010 Author Share Posted January 11, 2010 I implemented a CollisionCallback in order to detect a ball hitting the paddle. I need to figure out what direction it was moving in before it hit the paddle. I suppose I can do so using the normal the callback function provides. What mathgic would I need to pull off in order to do so? I also suppose I need to get the math books out again, lol Quote Link to comment Share on other sites More sharing options...
DaDonik Posted January 11, 2010 Share Posted January 11, 2010 The normal vector is the direction of the impact an thus also the direction of movement before the impact. Or did i get you wrong? 1 Quote (Win7 64bit) && (i7 3770K @ 3,5ghz) && (16gb DDR3 @ 1600mhz) && (Geforce660TI) Link to comment Share on other sites More sharing options...
Laurens Posted January 11, 2010 Author Share Posted January 11, 2010 You are right. I'll stop asking silly questions now Thanks! Quote Link to comment Share on other sites More sharing options...
DaDonik Posted January 11, 2010 Share Posted January 11, 2010 Just ask, no one here bites AFAIK Quote (Win7 64bit) && (i7 3770K @ 3,5ghz) && (16gb DDR3 @ 1600mhz) && (Geforce660TI) Link to comment Share on other sites More sharing options...
Niosop Posted January 11, 2010 Share Posted January 11, 2010 Plus having the answers to those questions here helps those who have the same questions and bother to search. Quote Windows 7 x64 - Q6700 @ 2.66GHz - 4GB RAM - 8800 GTX ZBrush - Blender Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.