xtreampb Posted July 11, 2013 Share Posted July 11, 2013 So i'm trying to throw a stone when i press the mouse. in my app::loop function i have this code if(window->MouseHit(1)) { Model *tStone=Model::Load("Models/Stone/Stone_1.mdl"); tStone->SetShape(Shape::Load("Models/Stone/Stone_1.phy")); tStone->SetMass(1); Vec3 mouseposition = window->GetMousePosition(); //mouseposition.z-=5; mouseposition=camera->UnProject(mouseposition); tStone->SetPosition(mouseposition); tStone->SetVelocity(Vec3(0,0,10)); } i'm using this as my reference. When i press my left mouse button, a stone is indeed "thrown" however when i move my mouse to a different location, the stone is still thrown in the same location, it didn't move to fallow my mouse from what i can tell. Am i doing this wrong, or should i report this as a bug? ~Xtreampb~ Quote bool Life() { while(death=false) { if(death==true) return death; } } I have found the secret to infinite life Did I help you out? Like my post! Link to comment Share on other sites More sharing options...
Admin Posted July 11, 2013 Share Posted July 11, 2013 You need to set the z component of the coordinate sent to the command, so it knows how far in front of the camera to transform it. Quote Link to comment Share on other sites More sharing options...
xtreampb Posted July 11, 2013 Author Share Posted July 11, 2013 ok i did that but the x,y coord doesn't move when the mouse move. Quote bool Life() { while(death=false) { if(death==true) return death; } } I have found the secret to infinite life Did I help you out? Like my post! 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.