Ask for a easy 3rd Person Camera game source!!

Discuss about anything related to the Irrlicht Engine, or read announcements about any significant features or usage changes.
Post Reply
jl0206
Posts: 55
Joined: Mon Jun 07, 2004 4:56 am

Ask for a easy 3rd Person Camera game source!!

Post by jl0206 »

I want a game that can kill enemy .
I only have the source that can walk,run,jump.
But I can't kill people . :D How to do that
Armen138
Posts: 298
Joined: Mon Feb 23, 2004 3:38 am

Post by Armen138 »

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 ;)
Tyn
Posts: 932
Joined: Thu Nov 20, 2003 7:53 pm
Location: England
Contact:

Post by Tyn »

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.
jl0206
Posts: 55
Joined: Mon Jun 07, 2004 4:56 am

Armen138

Post by jl0206 »

Thanks very much , I will try .
By the way , if I use a sword I have to check the distance between my people and the enemy . how can i do this ??? I use the 3rd camera .
Tyn
Posts: 932
Joined: Thu Nov 20, 2003 7:53 pm
Location: England
Contact:

Post by Tyn »

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.
warui
Posts: 232
Joined: Wed Apr 14, 2004 12:06 pm
Location: Lodz, Poland
Contact:

Post by warui »

> 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().
Tomasz Nowakowski
Openoko - www.openoko.pl
Post Reply