I want a game that can kill enemy .
I only have the source that can walk,run,jump.
But I can't kill people . How to do that
Ask for a easy 3rd Person Camera game source!!
have some enemies running around in your level, have a look at the node-selection code in the collision detection tutorial to see what enemy the camera is looking at, add a firebutton to your eventreceiver,
and have the enemy you are looking at drop dead when you press your firebutton. happy killing
and have the enemy you are looking at drop dead when you press your firebutton. happy killing
Draw a ray from the player's weapon forwards. Change the target's position to whatever random offset you want for recoil, extend the ray to the weapon's maximum distance and do some collision detection with the ray to find the first node that is hit by the ray. If it hits something then you find out what and decide what you are going to do about it. I am actually working on this exact same thing right now.
Find out where on the model you want to measure from and find the positions on both meshes. Then create a core::line3d from each point. There is a function to find the distance inside the core::line3d called getLength(). This should be what you need.
BTW, if anyone has a solution to extending a ray to the weapon's maximum distance in 3D rather than 2D I would be gratefull. I think that the getIntersectionWithSphere() function inside core::line3d could be part of the solution but I'm not totally sure.
BTW, if anyone has a solution to extending a ray to the weapon's maximum distance in 3D rather than 2D I would be gratefull. I think that the getIntersectionWithSphere() function inside core::line3d could be part of the solution but I'm not totally sure.
> Find out where on the model you want to measure from and find the
> positions on both meshes. Then create a core::line3d from each point.
> There is a function to find the distance inside the core::line3d called
> getLength(). This should be what you need.
Yu can use vector3d< T >::getDistanceFrom() or (faster) vector3d< T >::getDistanceFromSQ().
> positions on both meshes. Then create a core::line3d from each point.
> There is a function to find the distance inside the core::line3d called
> getLength(). This should be what you need.
Yu can use vector3d< T >::getDistanceFrom() or (faster) vector3d< T >::getDistanceFromSQ().
Tomasz Nowakowski
Openoko - www.openoko.pl
Openoko - www.openoko.pl