MrIslomaniac Posted July 4, 2010 Share Posted July 4, 2010 What would be the easiest way to enable camera collision, just like the one in the editor? Need this for a presentation on Tuesday =(, got to hurry up now Hope you guys can help me Thanks Quote Link to comment Share on other sites More sharing options...
macklebee Posted July 4, 2010 Share Posted July 4, 2010 look at the Making A Spectator tutorial. Quote Win7 64bit / Intel i7-2600 CPU @ 3.9 GHz / 16 GB DDR3 / NVIDIA GeForce GTX 590 LE / 3DWS / BMX / Hexagon macklebee's channel Link to comment Share on other sites More sharing options...
MrIslomaniac Posted July 4, 2010 Author Share Posted July 4, 2010 oh thank you macklebee, didn't think of that =) you saved my day Greetings, Dustin Quote Link to comment Share on other sites More sharing options...
MrIslomaniac Posted July 5, 2010 Author Share Posted July 5, 2010 Hey, it's me again. I did some coding, but i don't seem to get any collision working: TBody Spectator = CreateBodySphere(0.1f); SetBodyMass(Spectator,1); SetBodyGravityMode(Spectator,0); PositionEntity(Spectator,EntityPosition(cam)); SetBodyDamping(Spectator,10.0); EntityType(Spectator,1); EntityType(game.scene.scene,1); TBody Sphere = CreateBodySphere(); PositionEntity(Sphere,Vec3(0,50,0)); ScaleEntity(Sphere,Vec3(10,10,10)); EntityType(Sphere,1); SetBodyGravityMode(Sphere,0); Collisions::Set(1,1,SLIDINGCOLLISION); In DebugPhysics, they just go through each other. Any idea? Quote Link to comment Share on other sites More sharing options...
ZioRed Posted July 5, 2010 Share Posted July 5, 2010 Tried to set the body mass of Sphere? Quote ?? FRANCESCO CROCETTI ?? http://skaredcreations.com Link to comment Share on other sites More sharing options...
MrIslomaniac Posted July 5, 2010 Author Share Posted July 5, 2010 Thanks for your answer, but that does not work either =( Quote Link to comment Share on other sites More sharing options...
macklebee Posted July 5, 2010 Share Posted July 5, 2010 Hey, it's me again. I did some coding, but i don't seem to get any collision working: TBody Spectator = CreateBodySphere(0.1f); SetBodyMass(Spectator,1); SetBodyGravityMode(Spectator,0); PositionEntity(Spectator,EntityPosition(cam)); SetBodyDamping(Spectator,10.0); EntityType(Spectator,1); EntityType(game.scene.scene,1); TBody Sphere = CreateBodySphere(); PositionEntity(Sphere,Vec3(0,50,0)); ScaleEntity(Sphere,Vec3(10,10,10)); EntityType(Sphere,1); SetBodyGravityMode(Sphere,0); Collisions::Set(1,1,SLIDINGCOLLISION); In DebugPhysics, they just go through each other. Any idea? I am not a c++ guy, but I have some questions about your code. Is 'game.scene.scene' the actual entity you loaded with LoadScene()? Are you using lua inconjuction with c++? Have you tried just: Collisions::Set(1,1,1); just in case, SLIDINGCOLLISION is not being defined? Is the Spectator being parented to the cam? Quote Win7 64bit / Intel i7-2600 CPU @ 3.9 GHz / 16 GB DDR3 / NVIDIA GeForce GTX 590 LE / 3DWS / BMX / Hexagon macklebee's channel Link to comment Share on other sites More sharing options...
MrIslomaniac Posted July 5, 2010 Author Share Posted July 5, 2010 spectator is not parented, i move the spectator and place the cam at the new position. I am using gamelib, which complicates things even more(e.g. slidingcollision). But i just figured it out myself =) the scene does not react on physics, i don't know why, it just doesn't So i created them by hand and it worked TBody spectator=CreateBodySphere(); SetBodyMass(spectator,1); SetBodyGravityMode(spectator,0); EntityType(spectator,1); SetBodyDamping(spectator,1.0); ::Collisions(1,1,1); TBody Sphere = CreateBodySphere(0.3049625f); EntityType(Sphere,1); SetBodyGravityMode(Sphere,0); SetBodyMass(Sphere,0); Now it works, thank you all Greetz Quote Link to comment Share on other sites More sharing options...
MrIslomaniac Posted July 5, 2010 Author Share Posted July 5, 2010 Well just found another "bug"... All my physics object get stuck when they are too far away from the center(like 4000 units from the center) any clue? I can't move them anymore once they got stuck. Quote Link to comment Share on other sites More sharing options...
macklebee Posted July 5, 2010 Share Posted July 5, 2010 what version are you using? this issue or one very similar was supposedly fixed for LE 2.32 according to this BugReport Also, you may want to look at downloading the newton SDK and getting the latest newton.dll from it. A couple of bugs were fixed that caused fast moving objects to pass through terrain, and I am not sure if Josh has incorporated the newest newton.dll into the Leadwerks SDK. Quote Win7 64bit / Intel i7-2600 CPU @ 3.9 GHz / 16 GB DDR3 / NVIDIA GeForce GTX 590 LE / 3DWS / BMX / Hexagon macklebee's channel Link to comment Share on other sites More sharing options...
DaDonik Posted July 5, 2010 Share Posted July 5, 2010 I can't move them anymore once they got stuck. SetWorldSize() is what you are searching for. Your objects are just stuck in the boundaries of your physics world Quote (Win7 64bit) && (i7 3770K @ 3,5ghz) && (16gb DDR3 @ 1600mhz) && (Geforce660TI) Link to comment Share on other sites More sharing options...
MrIslomaniac Posted July 6, 2010 Author Share Posted July 6, 2010 YYa found that out too, thank you =) All works now, my first project has been finished and shown to an audience at a competition. If i win, I will publish the program here Dustin Quote Link to comment Share on other sites More sharing options...
Canardia Posted July 6, 2010 Share Posted July 6, 2010 I am using gamelib, which complicates things even more(e.g. slidingcollision).Slidingcollison is a LEO feature, not gamelib. Gamelib doesn't change any engine commands, but only adds new unique commands. Quote ■ Ryzen 9 ■ RX 6800M ■ 16GB ■ XF8 ■ Windows 11 ■ ■ Ultra ■ LE 2.5 ■ 3DWS 5.6 ■ Reaper ■ C/C++ ■ C# ■ Fortran 2008 ■ Story ■ ■ Homepage: https://canardia.com ■ 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.