Search the Community
Showing results for tags 'Collision'.
-
With Lua I could use Script:Collision( entity, position, normal, speed) and place out a box-trigger. Found a video illustrating this in Lua: But how could I do that in C++? I have looked in Entity.h for clues and I suspect it might be OnCollision(...) but not sure howto. Maybe this should be mentioned in the documentation with an example.
-
Hello i recently bought leadwerks on steam to create a game. At the moment i am doing random things in leadwerks to see how everything works. At this point i am trying to get collisions right. I downloaded some content from the steam workshop including this warehouse. How can i get the collisions right? When the player walks against the wall he stops when he walks up the stairs the Y slowly increases. I googled around and found some c++ scripts but i want to create this in lua. I recently started learning lua, so i am not an expert. I hope someone can help me with this thanks!
-
Could someone please let me know why CameraPick doesn't pick model in the following code? #include "engine.h" int WINAPI WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLine, int nShowCmd) { Initialize(); Graphics(640,480); TFramework fw = CreateFramework(); SetGlobalObject("fw",fw); TCamera camera=GetLayerCamera(GetFrameworkLayer(0)); PositionEntity(camera,Vec3(0,5,-12)); RotateEntity(camera,Vec3(15,0,0)); TLight light=CreateDirectionalLight(); RotateEntity(light,Vec3(45,45,45)); TMesh cube=CreateCube(); EntityType(cube,1); TMesh model=LoadModel("abstract::frame.gmf"); PositionEntity(model,Vec3(1,1,0)); EntityType(model,1); Collisions(1,1,true); while(!KeyHit(KEY_ESCAPE)) { TPick pick; UpdateFramework(); RenderFramework(); if(CameraPick(&pick,camera,Vec3(MouseX(),MouseY(),1000),0,1)) DrawText(0,20,"HIT"); Flip(0); } return 1; } As it stands, CameraPick only picks the cube. If I change the collision type to 0, it selects both the cube and the model. Any ideas?