A player/car object conflict
by Columbus State University (#0013 · in Torque Game Engine · 03/01/2006 (1:49 pm) · 2 replies
Currently, I am trying to make a box like object move Up and down and left and right. I was able to move the player/car up and down but i can't seem to make the box object the player/object. Can someone help me?
#2
Nope. Player is a direct decendant of ShapeBase. This is on the C++ side, but that is reflected in script as well.
Here's a handy reference link: http://www.garagegames.com/docs/tge/engine/hierarchy.php
You'll find ShapeBase and Player about a quart of the way down this rather long list. Their class heirarchy starts with "ConsoleObject" (which covers everything scriptable in the game... quite the extended family there).
So looking at ShapeBase's "Detailed description":
"
ShapeBase is the renderable shape from which most of the scriptable objects are derived, including the player, vehicle and items classes.
ShapeBase provides basic shape loading, audio channels, and animation as well as damage (and damage states), energy, and the ability to mount images and objects.
"
Sadly, Player doesn't have a similar description, but looking at its member functions can provide the clues we need:
Animiation
velocity
mass
momentum
ControlObject
etc...
plus what looks like a lot of overrides for things like processTick and so on.
I just bookmarked that link myself, I recommend you hang on to it as well. Very Useful.
Huh... scrolling down a bit further in ShapeBase's page, I noticed that it has setVelocity and applyImpules members as well (but nothing to check mass/momentum/etc, but does have member vars to store them). Some animation members too. :?
Now I'm confused.
--Mark
03/14/2006 (8:21 am)
I'm with Bruno on this one. There's a lot of Stuff in the Player class that allows it to do all the things a player does... things a shape lacks. IIRC, Player is actually a subclass of Shape, though I believe there are a couple intermediate layers. Lets see...Nope. Player is a direct decendant of ShapeBase. This is on the C++ side, but that is reflected in script as well.
Here's a handy reference link: http://www.garagegames.com/docs/tge/engine/hierarchy.php
You'll find ShapeBase and Player about a quart of the way down this rather long list. Their class heirarchy starts with "ConsoleObject" (which covers everything scriptable in the game... quite the extended family there).
So looking at ShapeBase's "Detailed description":
"
ShapeBase is the renderable shape from which most of the scriptable objects are derived, including the player, vehicle and items classes.
ShapeBase provides basic shape loading, audio channels, and animation as well as damage (and damage states), energy, and the ability to mount images and objects.
"
Sadly, Player doesn't have a similar description, but looking at its member functions can provide the clues we need:
Animiation
velocity
mass
momentum
ControlObject
etc...
plus what looks like a lot of overrides for things like processTick and so on.
I just bookmarked that link myself, I recommend you hang on to it as well. Very Useful.
Huh... scrolling down a bit further in ShapeBase's page, I noticed that it has setVelocity and applyImpules members as well (but nothing to check mass/momentum/etc, but does have member vars to store them). Some animation members too. :?
Now I'm confused.
--Mark
Torque Owner Bruno Grieco
If you need your player to be a box the easiest approach would be using the player object and modelling the player as a box.