equitypoint

Blitz3D Forums/Blitz3D Beginners Area/equitypoint

Jack(Posted 2011) [#1]
I understand that equitypoint turns an object toward another object.

Lets assume the target is at position x300,y0,z400

And the source entity is at x100,y0,z0

so I use "entitypoint source,target"; Now the source turns.I guess?

what commad do i now use to move the source toward the target? I have been using the "moveentity x,y,z" after computing the angle but if the point command is eaiser it would speed things up.


Guy Fawkes(Posted 2012) [#2]
Yes, using EntityPoint(thepointERobject, thepointEEobject), u can effectively point object A, to object B! =D


Zethrax(Posted 2012) [#3]
Firstly, the command is called 'PointEntity'. Not 'equitypoint', and not 'EntityPoint'.

PointEntity entity, target[, roll#]

That command will immediately point the specified entity at the position of the target entity with the ability to optionally specify the roll (rotation around the Z axis). You can then use MoveEntity with a positive Z value and zero X and Y values to move the source entity towards the target entity.

PointEntity entity, target
MoveEntity entity, 0.0, 0.0, 1.0

If you need less abrupt alignment then you would probably need to use AlignToVector instead of PointEntity.

You can also find some code I wrote to do something similar on a 2D plane at the link below.

http://www.blitzbasic.com/codearcs/codearcs.php?code=2258


Ross C(Posted 2012) [#4]
You could also look at the deltayaw and deltapitch commands, if you want a little more control over your transition.


Jack(Posted 2012) [#5]
Thanks.

"EQUITYPOINT" must have been a senior moment thingy,