TwigObject members
Instance members
Constructor
TwigObject(TwigGame g, string name, bool isDynamic)
Sets the TwigGame, Name, and Dynamic properties of the object.
Properties
- AABB
The axis-aligned bounding box of the object
- Atlas
Dictionary of named for the object. A chart is essentially a named,
task-specific, object-centered coordinate system.
- BasicEffect
Returns a BasicEffect object shared by all TwigObjects.
- CenterOfMass
Location of the object's center of mass
- ChartSection
Which section of the chart recorder to display this object's information in.
0=top, 1=bottom, -1= not displayed (default).
- Cloaked
If true, object is invisible to characters
- CollisionElements
Returns an array of the CollisionElements associated with the object
- Color
The color of the object for those classes that support it.
- DebugString
Overload this to change the debug information that gets displayed in the
StandardHUD when this object is the selected DebugObject
- Device
The graphics device used in the game.
- DialogBalloonManager
Returns the DialogBalloonManager for the game.
- DockingDirection
The direction from which to approach this object when docking with it, e.g.
when sitting down.
- DockingDistance
The distance to approach to when docking
- DockingTarget
The specific node to approach when docking with the object
- Dynamic
True if the object ever moves. False for things like trees.
- FacingDirection
A unit vector in the direction the object is "facing", or zero, if facing
direction is undefined for this type of object (e.g. a ball).
- Grasper
The TwigObject that is currently grasping this object, if any.
- GraspingLimb
The Limb object that is currently grasping this object, if any.
- GraspedNode
The node on the object grasped by the grasper.
- IDrawable.Visible
True if the object is being drawn on the screen.
- IsASupportingSurface
True if this object is a SupportingSurface like a table or chair.
- IsBeingManipulated
True if this object is being manipulated by the character grasping it.
- IsGrasped
True if this object is being grasped by a character.
- IsObstacle
True if characters should treat this object as a potential obstacle and walk
around it rather than walking over it, when trying to go elsewhere.
Trees are obstacles, pens are not.
- IsSittable
True if you can sit on this object.
- IUpdatable.Enabled
True if this object's Update() method should get called.
- Links
An array of all links comprising the object, if any.
- LookPoint
The point that characters looking at this object should gaze at.
- Mass
Mass of the object
- Name
A string used for debugging purposes and for identifying the object in the
scripting language.
- NodeFrame
Defined only for SupportingSurfaces whose surfaces move. A collection
of 3 nodes from the object whose positions can be used as a barycentric
coordinate system for nodes supported by the surface. When the surface
moves, the positions of the supported nodes are moved along with it.
- Nodes
An array of all nodes comprising the object. TwigObjects must have at
least one node.
- Position
The Vector3 defining this object's position. For objects that normally
rest on the ground, this would normally lie somewhere on the bottom of the
object, but this isn't enforced. It is most commonly at the center of
the object's projection into its supporting surface.
- Printf(string s)
Printf(string s, object o1, ...)
Adds string to list of lines to be printed in the HUD when the object is the
DebugObject. If multiple arguments are supplied, then String.Format is
called on all arguments before display. Up to 5 arguments are
currently supported.
- ScreenPosition
Projection into screen coordinates (pixels, not NDC) of the Position
property of the object.
- SittingTarget
The specific node of the object that a character should sit on/over when
sitting on this object.
- SittingTargetRadius
The distance around SittingTarget that constitutes sitting on the object.
- SupportingSurfaceLevel
For SupportingSurfaces only; The height at which this object holds the
objects it supports.
- TwigGame
The TwigGame this object is a part of.
Methods
- Chart(string label, float value, float maxValue)
Debug builds only; plots a point with the specified value in the chart with
the specified label. maxValue is used only for scaling purposes.
- ConfigureMaterial()
Sets the color properties of the shared BasicEffect object based on the
Color property of this object.
- Constrain()
Called by the Physics system. Adjusts object's nodes positions based
on any geometric constraints within the object, such as link lengths.
- Draw(GameTime t)
Draw object on the game's Device.
- IsApproachingTarget(TwigObject target)
True if this object is trying to approach that target.
- IsSupporting(Node n)
True if this is the supporting surface for the specified node.
- IsSupporting(TwigObject o)
True if this is the supporting surface for some node of o.
- IsSupporting(Vector3 p)
True if this object would be a supporting surface for a node if that node
were at point p
- LookingAt(TwigObject o)
True if this object is looking at object o. False if this object isn't
a character.
- OnDismount(Node n, TwigObject supportingSurface)
Called when node n of this object has moved off of its previous supporting
surface.
- OnGrasped(Limb graspingLimb)
Called after a limb has attached itself to this object
- OnMount(Node n, TwigObject supportingSurface)
Called node n of this object moves over a new supporting surface.
- OnUngrasping()
Called just before a character lets go of this object.
- SelectGrasp(Mammal grasper, Grasp graspRequest, out Grasp selectedGrasp,
out Node leftTarget, out Node rightTarget)
Called when grasper wants to grasp this object. graspRequest is a
bitset of the possible types of grasps (LeftHand, RightHand, TwoHanded,
None), which the Mammal can presently handle. Method returns results
through out parameters: selectedGrasp is the chosen grasp, and leftTarget
and rightTarget are the nodes the respective hands should attempt to grasp,
if any.
- SetupHold(Mammal grasper, Grasp grasp)
Called when grasper wants to grasp (if not yet grasped) and hold this
object, but not hold the object in its "use" position. The object
should therefore be allowed to swing loosely at the grasper's side.
- SetupHoldForUse(Mammal grasper, Grasp grasp)
Called when grasper wants to grasp (if not yet grasped) and hold this
objectin its "use" position. The object should now move to the use
position and however there until such time as SetupHold is called (or let it
hang loosely) or the object is dropped.
- TeleportTo(Vector3 position)
Deprecated. New code should just assign the Position property.
Moves object to specified position, without altering its pose.
Velocity of all nodes is set to zero.
- TransformPose(Matrix m)
Changes positions of all nodes in object based on matrix. All node
velocities are set to zero. Use for moving, turning, or stretching
object.
- TransformPoseAboutPosition(Matrix m)
Changes positions of all nodes in object based on matrix m, but within a
coordinate system centered at the object's position. All node
velocities are set to zero. Use for moving, turning, or stretching
object.
- Update(GameTime t)
Does whatever update this object needs to do.
- Velocity
Velocity of the object.
Events
- Dismount(Node n, TwigObject supportingSurface)
Called when a node n of this object that had previously been supported by
supportingSurface, moves off of that surface.
- Grasped(Limb graspingLimb)
Called when the object has just been grasped by a character
- Mount(Node n, TwigObject supportingSurface)
Called when the object moves over a supportingSurface so that one of its
nodes, n, changes its supporting surface.
- Ungrasping()
Called just before a character lets go of the object.
- UpdateThunks
Called when Update() is called on the object.
Static members
Properties
- AllTwigObjects
A List<TwigObject> of all instantiated TwigObjects. This will likely
be deprecated in the future, when support is added for having multiple sets
(in the sense of scenery). Then it will be necessary to worry about
whether a TwigObject is on the current set or instantiated, but in a set
used for another scene.
- DynamicTwigObjects
Like AllTwigObjects, but only the dynamic objects. May be deprecated
in the future, see AllTwigObjects.
Methods
- LookingAt(TwigObject subject, TwigObject object)
True if subject is gazing at object.