Game Development Community

Point3F

by suddysud aka mrclean · in Torque Game Engine · 01/23/2006 (8:25 am) · 6 replies

I notice that there are some methods like AIPlayer.setImpulse(); which takes as its paramater Point3F.

Now from my experience with java Point3F would have to be an Point3F object that one would have to pass into it.

And I don't seem to be able to find a reference to Point3F to know what type of information to create.

Does anyone know the answer to this ? is it simply 3 numbers like "1 0 0" for x y z or is this a special Object ?


And is there a reference for other such descriptions -
I just want to know so I'll be able to supply the information these functions and methods are referring to.

Thanks in Advance

STephen

#1
01/23/2006 (9:52 am)
I think you're referring to script, yes ?

In script, Point3F is as you guess, just three numbers seperated by spaces: "x y z".

In C++ it's a proper object with methods etc.

Here is a useful windows help file which is the torquescript docs:
home.parse.nl/~daan/torque/TorqueScript_1_3_0_v1_2.zip
#2
01/23/2006 (9:55 am)
---- edit----

Orion beat me to it :-)
#3
01/23/2006 (5:07 pm)
Thanks;
However, there does not appear to be a reference in the .chm file to Point3F
#4
01/23/2006 (5:44 pm)
Sure there is -

Quote:
bool ShapeBase::applyImpulse ( Point3F Pos, VectorF vel )

but if you're looking for a Definition of Point3F, then yeah, you're probably right.

as far as torquescript, any value-triple is the same as another.
so you can treat these 'classes' pretty interchangably: Point3F, Point, Vector3F, Vector.

i think part of the issue is that torquescript isn't actually Typed,
so the argument definitions in that file are just programmer comments basically, and unchecked by the compiler.
#5
01/23/2006 (6:20 pm)
Double checking.

Are you saying VectorF vel also a triple number?

What would I pass to VectorF vel?

And by the way what in the world does applyImpulse do ?


Thanks again
#6
01/23/2006 (6:27 pm)
Apply impulse um... aplies an impulse to an object like a player.
that's "impulse" as in "Impulse Engines". heh.

It gives the player a shove.

vel is the vector of the shove,
and pos i believe is the location it's applied at.

and yes, you're correct, both those values are "x y z" triples.

- In the engine C++ source there's a good reason to distinguish between Vectors and Points,
but in script it makes very little difference.

in practice that Vel value has to be pretty large for applyImpulse().
try this:
%someServerSidePlayer.applyImpulse("0 0 0", "0 0 10000");