T2DLightComponent

A light component specific to 2D scenes.

T2DRenderManager

Render manager for 2D objects or 3D objects in a 2D scene. This should only be used for objects in a T2DSceneGraph. To add objects to this render manager set the render instance type to Mesh2D. To add 3D objects, set the render instance type to Mesh3D and set the BinOverride on the SceneRenderer to Mesh2D.

Methods

_Cleanup3DState(GarageGames.Torque.SceneGraph.SceneRenderState,Microsoft.Xna.Framework.Graphics.GraphicsDevice)

Cleans up the render state after rendering 3D objects in the 2D scene.
Param(s)d3d: The current graphics device.

_Setup3DState(GarageGames.Torque.SceneGraph.SceneRenderState,Microsoft.Xna.Framework.Graphics.GraphicsDevice)

Sets up the render state for rendering 3D objects in the 2D scene.
Param(s)d3d: The current graphics device.

TranslucentInstance2DComparison

Comparer for 2D render instances.

TranslucentRenderManager2D

Render manager for translucent objects. Objects with RenderInstanceType Translucent are added to this manager. It renders all objects in back to front order so translucency is properly represented.

T2DAnimatedSprite

Animated Sprite Class.

Methods

AdvanceFrame

Advances the frame of the animation by one frame. If the AnimationCycle is true and the animation is on its last frame, this will properly reset the animation to it's first frame.

ClearAnimationQueue

Clears all previously queued animation cues from the list. Call this to guarantee that when the current animation is finished no other animations will be loaded.

EnqueueAnimation(GarageGames.Torque.T2D.T2DAnimationData)

Generates and adds an animation cue to the animation queue to be played after all animations are finished.
Param(s)animData: The animation data to add to the animation queue.

EnqueueAnimation(GarageGames.Torque.T2D.T2DAnimationCue)

Adds an animation cue to the animation queue to be played after all animations are finished.
Param(s)animCue: The animation cue to add to the animation queue.

GenerateAnimationCue

Generates an animaton cue object for the current animation data and time settings. This can be used to restore the animation to it's current state later on.

LoadAnimationCue(GarageGames.Torque.T2D.T2DAnimationCue)

Attempts to load the specified animation cue.
Param(s)animCue: The T2DAnimationCue to try to load.

LoadNextCueInQueue

Finds and loads the next valid animation cue in the animation queue.

PauseAnimation

Pauses the current animation.

PlayAnimation

Passes the animation data to the animation controller and begins the animation

PlayAnimation(GarageGames.Torque.T2D.T2DAnimationData)

Plays an animation with specified animation data.
Param(s)data: animation data

PlayAnimation(GarageGames.Torque.T2D.T2DAnimationData,System.Single)

Plays the specified animation data. When that animation is completed, the animation currently playing (at the time you call this method) will be loaded and resume from the time specified.
Param(s)data: The animation to play
autoRestoreTime: The time in seconds from which to continue playing the current animation.

PlayAnimation(GarageGames.Torque.T2D.T2DAnimationData,System.Boolean)

Plays an animation with specified animation data and either queue up the currently playing animation to continue after the specified animation is finished -or- clears all queued animations and does not auto-restore. If you do not wish to auto restore the currently playing animation, but want to keep the animation queue intact, use the PlayAnimation(T2DAnimationData data) version of this method.
Param(s)data: The animation data to use.
autoRestoreAnimation: True if the animated sprite should return to it's current animation once the specified animation is finished. False if the animation should not auto restore and the entire animation queue should be cleared.

ResumeAnimation

Resumes the current paused animation.

SetAnimationFrame(System.UInt32)

Sets the current frame of the animation.
Param(s)index: The frame of the animation to skip to.

Properties

AnimationCycleReturns whether the animated sprite is set to cycle or not. This should be defined in the animation data. AnimationDataT2DAnimationData to be used in the animation AnimationDurationReturns the total animation duration. This time is divided up amoungst the frames. If there are more frames in the animation the time spent on each frame will be less. This should be defined in the animation data. AnimationPausedPauses or unpauses the animation. AnimationTimeScaleScales the animation speed. CurrentFrameReturns the current animation frame index CurrentTimeReturns the current animation time FinalFrameReturns the final frame index IsAnimationPlayingSpecifies whether or not the animation is both playing and not yet finished. OnAnimationEndDelegate to be called when the animation ends. OnFrameChangeDelegate to be called when a frame changes. PlayOnLoadSpecify whether the animation should begin playing automatically when it is registered. True by default. RandomStartSpecifies to choose a random starting frame. RemoveOnFinishedSpecifies whether the animation should be unregistered once it is finished. StartFrameSpecifies the start frame of the animation data to begin the animation

T2DAnimationComponent

Add this component to a T2DSceneObject in order to animate particular float interfaces. Float interfaces are exposed by other components in the RegisterInterfaces call and can be looked up by name and type. This component animates ValueInterfaces which are exposed as "float" type.

Methods

PauseAnimation(System.Int32)

Pause indexed animation. A paused animation which is re-started will not be initialized again (so if it was at the end of the sequence and was neither cyclic or ping pong it will not play again, it will also not choose a random start location even if RandomStart property is true).
Param(s)animationIdx: Animation index.

PlayAnimation(System.Int32)

Start indexed animation.
Param(s)animationIdx: Animation index.

SetAnimationScale(System.Int32,System.Single)

Set the time scale for the index animation. Time scale is multiplied by time when updating, so a scale of 0 is similar to pausing the animation and a scale of 2 will play it twice as fast.
Param(s)animationIdx: Animation index.
scale: Time scale.

StopAnimation(System.Int32)

Stop indexed animation. A stopped animation which is re-started will be initialized (it will start at a random place in the sequence if RandomStart is true and it will continue playing even if was previously stopped for being at the end).
Param(s)animationIdx: Animation index.

Properties

AnimationsList of animations this component can play.

Animation

Describes the animation of a float ValueInterface.

T2DAnimationController

Used for controlling animations. Determines when frame changes should occur, looping and ending of animations.

Methods

AdvanceAnimation(System.Single)

Updates and determines the current frame based on the time delta.
Param(s)dt: The change in time to impart on the animation.

InitAnimation

Initializes the animation and prepares it to recieve updates.

ResetAnimation

Resets the current time and animation finished status.

SetAnimationFrame(System.UInt32)

Sets the current animation frame and updates the animation.
Param(s)frameIndex: frame index to set the animation to

UpdateAnimation

Updates the current frame, current time, and animation finished fields based on the current data without advancing the animation.

_CalculateAnimationTime

Calculates the per frame integration time.

Properties

AnimationCycleSpecifies whether or not to repeat the animation. If true, the animation will cycle. AnimationDurationSpecifies the total duration of the animation. This time is divided up amongst the frames. If there are more frames in the animation the time spent on each frame will be less. AnimationFinishedReturns true if the animation has completed. AnimationFrameCountSpecifies the total number of frames in the animation. AnimationTimeScaleSpecifies the animation's time scale. This is not cumulative: it will only affect subsequent calls to AdvanceAnimation, not previous ones. CurrentFrameReturns the current animation frame index. CurrentTimeReturns the current animation time. FinalFrameReturns the final frame index. IsInitializedSpecifies whether or not this animation controller has been fully initialized. RandomStartSpecifies to choose a random starting frame rather than using the StartFrame property. StartFrameSpecifies the desired frame of the animation to begin. If the frame is beyond the FinalFrame, zero will be used. This property is ignored if RandomStart is set to true.

T2DAnimationCue

This is a data type designed to enable auto-restoring interrupted animations, but it could potentially be used to start any animation at a specific time.

T2DAnimationData

Animation data used in animated sprites. Consists of a material and animation frames definition properties.

Methods

Init

Generates the list of frames to be used in the animation based on available frames and the AnimationFrames property Each frame specifies the texture coordinates for that particular frame from the specified texture. This is a public function in the event that an animation recieves data that has not been initialized yet.

OnLoaded

Once the data properties and texture has been loaded - initialize the animation data.

Properties

AnimationCycleDetermines whether the animation will cycle, or repeat once it has finished. Set it to true to cycle, false if you want to animation to stop once it has finished. AnimationDurationTotal duration of the animation. This is the total time it takes to integrate through all the frames of the animation AnimationFramesString representing the frames to be used in the animation. Seperated by spaces, frames begin at 0 and can be repeated. AnimationFramesListList of texture coordinates generated by the initialized animation data IsInitializedHas the AnimationData been initialized yet? MaterialMaterial or texture used by the animation data

T2DCollisionComponent

Adding this component to a T2DSceneObject allows it to collide with other scene objects. A T2DCollisionComponent can be configured to collide with only certain other object types (see CollidesWith property), can have one or more collision images installed (see InstallImage method), and can have collision callbacks defined (see OnCollision property).

Methods

InstallImage(GarageGames.Torque.T2D.T2DCollisionImage)

Install a new collision image. When moving, the object checks each collision image installed against all the collision images of whatever objects it moves toward.
Param(s)image: The collision image to add.

MarkCollisionDirty

Tells all of the collision images associated with this component to regenerate any internally cached collision values such as collision poly lists.

RemoveImage(GarageGames.Torque.T2D.T2DCollisionImage)

Remove a collision image previously installed.
Param(s)image: Collision image to remove.

RenderBounds(GarageGames.Torque.SceneGraph.SceneRenderState)

Render the bounds of each collision image. Typically called from T2DSceneObject.Render.
Param(s)srs: Scene render state passed in for rendering purposes.

TestMove(System.Single@,Microsoft.Xna.Framework.Vector2,System.Collections.Generic.List{GarageGames.Torque.T2D.T2DCollisionInfo})

Test movement from current scene position in the direction of velocity for given time interval. Note: it is the callers responsibility to call OnCollision for each collision. Normally, this is handled by the T2DPhysicsComponent.
Param(s)dt: Move object for duration, in seconds.
velocity: Velocity to move at.
collisions: List of collision information. For each collision encountered a new T2DCollisionInfo will be added.

TestMoveTo(Microsoft.Xna.Framework.Vector2@,System.Collections.Generic.List{GarageGames.Torque.T2D.T2DCollisionInfo})

Test movement from current scene position to passed scene position. Note: it is the callers responsibility to call OnCollision for each collision. Normally, this is handled by the T2DPhysicsComponent.
Param(s)pos: New position. On exit, pos will be farthest toward target position object can move without a collision.
collisions: List of collision information. For each collision encountered a new T2DCollisionInfo will be added.

Properties

CollidesWithDetermines which object types (see T2DSceneObject.ObjectType property) to collide with. TorqueObjectTypes can be combined to form a collection of object types with which to collide. CollisionLayerMaskMask which determines which layers will be collided with. The layer of an object is determined by the T2DSceneObject.Layer property. Because this is a mask, each bit refers to a single layer, with bit N corresponding to layer N. A mask of 7, for example, indicates that the object will collide with objects on layers 1, 2, and 3. CollisionMaterialCollision material to be used in collisions of this object with other objects. EarlyOutObjectTypeDetermine which object types to test for early out on collision checking. ImagesRead only array of collision images. OnCollisionThis delegate is called whenever a collision occurs, possibly multiple times per tick. OnCollision should not be used for physical response. OnCollision should be used for game logic. Physical response is handled by a T2DResolveCollisionDelegate (on T2DPhysicsComponent). RenderCollisionBoundsIf true then collision bounds are drawn by the collision images. This is strictly a debug feature. ResolveCollisionDelegate used to determine how to respond to collisions. There are a number of stock options available: BounceCollision, ClampCollision, RigidCollision, StickyCollision, and KillCollision. Custom resolve delegates can also be used. SceneObjectThe owning T2DSceneObject. SceneObject is used to determine the extent of the collision region using the T2DSceneObject.Size property. SolveOverlapIf false then this object will never solve overlaps. Overlap between two objects can occur for a variety of reasons. Most common is that slight error was introduced during the collision checking. Solving the overlap removes accumulated error. But in some cases you don't want the small displacements which can occur because of this. E.g., projectiles which will be immediately destroyed do not need to solve the overlap and setting this property to false can get rid of the slight push that projectiles otherwise might have. TestEarlyOutTest whether or not a given object should be collided against. Use this for objects which sometimes collide and sometimes don't. If true is returned, then collision processing does not continue against the object. This can be used to make certain objects have collisions only under certain conditions, e.g., when going one way through a platform but not another. Note that this only affects collision checking when this object moves into another. Objects moving into this object do not use our TestEarlyOut delegate.

T2DCollisionImage

Abstract base class for collision 2D images usable by T2DCollisionComponent. This class is and so cannot be instantiated.

Methods

MarkCollisionDirty

Regenerate any internally cached collision values. This should be called if, for instance, a T2DSceneObject this collision belongs to is resized.

RenderBounds(Microsoft.Xna.Framework.Matrix,GarageGames.Torque.SceneGraph.SceneRenderState)

Render position of last collision point and normal. Strictly for debug purposes. Should be called by derived class.
Param(s)objToWorld: Current render transform.
srs: Scene render state passed in for rendering purposes.

TestMove(System.Single@,Microsoft.Xna.Framework.Vector2,GarageGames.Torque.T2D.T2DCollisionImage,System.Collections.Generic.List{GarageGames.Torque.T2D.T2DCollisionInfo})

Test whether this collision image collides with other image when moving at given velocity for given amount of time. Collisions are added to 'list'.
Param(s)dt: Time spent moving, in seconds.
ourVelocity: Our velocity.
theirImage: Collision image to test against.
list: List of collision information to which current collisions will be added to.

TestMoveAgainst(System.Single@,Microsoft.Xna.Framework.Vector2,GarageGames.Torque.T2D.T2DCollisionImage,System.Collections.Generic.List{GarageGames.Torque.T2D.T2DCollisionInfo})

Test whether other collision image collides with this image when moving at given velocity for given amount of time. Collisions are added to 'list'.
Param(s)dt: Time spent moving, in seconds.
theirVelocity: Other image velocity.
theirImage: Collision image to test against
list: List of collision information to which current collisions will be added to.

_AddCollisionPoint(System.Single@,System.Single,Microsoft.Xna.Framework.Vector2,Microsoft.Xna.Framework.Vector2,Microsoft.Xna.Framework.Vector2,GarageGames.Torque.T2D.T2DSceneObject,System.Int32,System.Collections.Generic.List{GarageGames.Torque.T2D.T2DCollisionInfo})

Derived classes should add collision points to 'list' using this method, which guarantees that duplicates are not added and that the list is proprly reset when earlier collisions are detected.

Properties

PriorityPriority of this collision image. The priority is used to determine which of two collision immages should do the testing when testing against each other. If the moving object has a higher priority, then the TestMove method is used. If the object being moved against has a higher priority then the TestMoveAgainst method is used. Tie goes to the object doing the moving. SceneObjectThe T2DSceneObject which this image belongs to.

T2DCollisionMaterial

Describes a physical surface for collision processing.

T2DControlComponent

This component automatically sets up an input map with all buttons, sticks, and triggers bound. Keyboard bindings are also setup to somewhat mirror those on the controller.

T2DForceComponent

Adding this component to a T2DSceneObject allows forces to be installed on the object. Forces can be mounted to link points (and hence rotated) and can have their strength modified over time using TorqueInterfaces.

Methods

AddForce(GarageGames.Torque.T2D.T2DForceComponent.Force)

Add a new force to this object. Force will continue to be applied until RemoveForce is called for the force.
Param(s)force: Force to applye.

GetRawForceStrength(GarageGames.Torque.T2D.T2DForceComponent.Force)

Get strength of given force, scaled between Force.MinStrength and Force.MaxStrength.
Param(s)force: Force to query.

GetRawForceStrength(System.Int32)

Get strength of indexed force, scaled between Force.MinStrength and Force.MaxStrength.
Param(s)idx: Index of force to query.

HasForce(GarageGames.Torque.T2D.T2DForceComponent.Force)

Determine whether a given force is being applied to this object.
Param(s)force: Force to test.

RemoveForce(GarageGames.Torque.T2D.T2DForceComponent.Force)

Remove an existing force. If force is not currently being applied then this method returns false.
Param(s)force: Force to remove.

Properties

CountNumber of current forces. ForceInstancesInstance data for current forces. ForcesForces which are currently applied. SceneObjectT2DSceneObject which owns the T2DForceComponent.

DragForce

A force which acts in the opposite direction as velocity.

DragForceBidirectional

A drag force which only acts on velocity in the direction and the opposite direction of the force as determined by constant direction, link nodes, and owning SceneObject direction.

DragForceDirectional

A drag force which only acts on velocity in the direction of the force as determined by constant direction, link nodes, and owning SceneObject direction.

Force

Base class for force to be added to T2DForceComponent.

MasslessForce

A force which ignores the mass of the object. Force strength is acceleration applied to object.

T2DGraphKey

Graph Key.

T2DKeyGraph

Key-Graph class responsible for storing a sequence of Keys which are used to drive particle-emitter/effect fields.

Methods

AddPrimaryKey(System.Single)

Change value of first keyframe.

CalcGraphBV(GarageGames.Torque.T2D.T2DKeyGraph,GarageGames.Torque.T2D.T2DKeyGraph,System.Single)

Static helper method to calculate value given base and variation key graphs. Formula for value is: value = base + GetRandom(-0.5*varition,0.5*variation).
Param(s)baseGraph: Base key graph.
variationGraph: Variation key graph.
effectAge: Time used to index key graphs.

CalcGraphBVE(GarageGames.Torque.T2D.T2DKeyGraph,GarageGames.Torque.T2D.T2DKeyGraph,GarageGames.Torque.T2D.T2DKeyGraph,System.Single)

Static helper method to calculate value given base and variation key graphs along with effect scaling graph. Formula for value is: value = base + scale * GetRangom(-0.5*variation,0.5*variation).
Param(s)baseGraph: Base key graph.
variationGraph: Variation key graph.
effectGraph: Effect key graph which scales emitter variation.
effectAge: Time used to index key graphs.

ResetKeys

Clear keyframe list and set to default value.

Properties

CountNumber of keyframes added to this key graph. DefaultValueValue of key graph if no keyframes added. Item(System.Single)Value of key graph at specified time. Time is clamped between 0 and LastTime. KeysInternal Key List for deserialization. LastTimeTime of last keyframe added to key graph. LastValueValue of last keyframe added to key graph. PrimaryKeyValue of the very first key. ValueScaleScale all values retrieved by this.

T2DKeyGraph_Base

Base Key-Graph Helper.

T2DKeyGraph_BaseVariation

Base/Variation Key-Graph Helper.

T2DKeyGraph_BaseVariationLife

Base/Variation/Life Key-Graph Helper.

T2DKeyGraph_Life

Life Key-Graph Helper.

T2DKeyGraph_Scale

Scale Key-Graph Helper.

T2DLayerSortDictionary

Used by the T2DSceneGraph to store and execute the sort modes for layers.

LayerOrderComparer

Sorts ISceneContainerObjects by layer order. This normally resolves to the object id, which is essentially the add order.

NegativeXAxisComparer

Sorts ISceneContainerObjects by the X axis sort point in reverse order.

NegativeYAxisComparer

Sorts ISceneContainerObjects by the Y axis sort point in reverse order.

NoSortComparer

Perform no actual sorting on layers.

XAxisComparer

Sorts ISceneContainerObjects by the X axis sort point.

YAxisComparer

Sorts ISceneContainerObjects by the Y axis sort point.

T2DLinkPointComponent

Add this component to a T2DSceneObject in order to add named link points to the object.

Methods

AddLinkPoint(System.String,Microsoft.Xna.Framework.Vector2,System.Single)

Add a named link point with given position and rotation. Position is in unscaled object space, so -1 to 1 ranges over the entire object (irrespective of Size).
Param(s)name: Name of new link point.
position: Link point position.
rotation: Link point rotation.

GetLinkPoint(System.String,Microsoft.Xna.Framework.Vector2@,System.Single@)

Get position and rotation of named link point, if it exists.
Param(s)name: Name of link point to query.
position: Link point position.
rotation: Link point rotation.

GetLinkPoint(System.String,GarageGames.Torque.Core.ValueInterface{Microsoft.Xna.Framework.Vector2}@,GarageGames.Torque.Core.ValueInterface{System.Single}@)

Get interfaces for position and rotation of named link point, if link point exists.
Param(s)name: Name of link point to query.
position: TorqueInterface for link point position.
rotation: TorqueInterface for link point rotation.

HasLinkPoint(System.String)

Determine whether named link point exists.
Param(s)name: Name of link point to query.

Properties

SceneObjectThe T2DSceneObject which owns this component.

T2DParticleEffect

A particle-effect encapsulates multiple particle-emitters. This class cannot be inherited.

Methods

PlayEffect(System.Boolean)

Start generating particles, optionally clearing out old particles.
Param(s)clearParticles: If true, old particles will be removed.

StopEffect(System.Boolean)

Stop generating new particles, optionally waiting for existing particles to clear before calling OnEffectStop.
Param(s)waitForParticles: If true, will wait for particles to clear.

Properties

AgeAge of effect, in seconds. Compare to LifeTime property of T2DEffectData. CurrentEffectDataThe T2DParticleEffectData which describes this effect. EffectPlayingTrue if effect is currently playing. EffectRotationTranslationMatrixMatrix representing translation and rotation of this effect. EffectTranslationMatrixMatrix representing translation of this effect. PlayOnLoadSpecify whether the effect should begin playing automatically when it is registered. True by default. WaitingForParticleClearTrue if emitter is waiting for particles to go away.

T2DParticleEffectData

T2DParticleEffectData describes the operation of a T2DParticleEffect.

Methods

AddEmitterData(GarageGames.Torque.T2D.T2DParticleEmitterData)

Add a new emitter description.
Param(s)emitterData: Emitter to add.

ClearEmitterData

Clear out all emitter descriptions.

ContainsEmitterData(GarageGames.Torque.T2D.T2DParticleEmitterData)

Test to see if effect data contains the given emitter data.
Param(s)emitterData: Emitter data to test.

FindEmitterData(System.String)

Return list of emitter data with the given name.
Param(s)name: Name to search for.

FindEmitterData(System.Int32)

Return indexed emitter data. Use EmitterCount property to determine number of emitter data.
Param(s)index: Index of emitter.

MoveEmitterData(GarageGames.Torque.T2D.T2DParticleEmitterData,GarageGames.Torque.T2D.T2DParticleEffectData.EmitterDataOrderChange)

Change the order of an emitter in the list. Returns new emitter index.
Param(s)emitterData: Emitter to move.
orderChange: Move operation.

RemoveEmitter(GarageGames.Torque.T2D.T2DParticleEmitterData)

Remove an emitter description from the effect.

ResetValues

Reset to default values.

Properties

EmissionAngleBaseUsed to determine emission angle of particles generated by emitters in this effect. Note: if ParticleEmitter.UseEffectEmission is false then this value is ignored. EmissionAngleVariationUsed to determine emission angle of particles generated by emitters in this effect. Note: if ParticleEmitter.UseEffectEmission is false then this value is ignored. EmissionArcBaseUsed to determine emission angle of particles generated by emitters in this effect. Note: if ParticleEmitter.UseEffectEmission is false then this value is ignored. EmissionArcVariationUsed to determine emission angle of particles generated by emitters in this effect. Note: if ParticleEmitter.UseEffectEmission is false then this value is ignored. EmissionForceBaseUsed to determine initial velocity when particle is first emitted. Note: if ParticleEmitter.UseEffectEmission is false then this value is ignored. EmissionForceVariationUsed to determine initial velocity when particle is first emitted. Note: if ParticleEmitter.UseEffectEmission is false then this value is ignored. EmitterCountNumber of emitters in this effect. EmitterDataListList of T2DParticleEmitterData, one for each emitter in the effect. Note: this interface is here for deserialization purposes only and is unsupported for any other purpose. FixedForceScaleScale the fixed force applied to particles generated by emitters of this effect based on the lifetime of the effect. LifeModeLife cycle parameters for particle effect. LifetimeLifetime of effect in seconds. ParticleLifeScaleScale the lifetime of particles generated by emitters of this effect based on the lifetime of the effect. QuantityScaleScale the rate of new particles generated by emitters of this effect based on the lifetime of the effect. RandomMotionScaleScale the radom velocity added to particles generated by emitters of this effect based on the lifetime of the effect. SizeXScaleScale the width of new particles generated by emitters of this effect based on the lifetime of the effect. SizeYScaleScale the height of particles generated by emitters of this effect based on the lifetime of the effect. SpeedScaleScale the speed of particles generated by emitters of this effect based on the lifetime of the effect. SpinScaleScale the rotation rate of particles generated by emitters of this effect based on the lifetime of the effect. VisibilityScaleScale the visibility of particles generated by emitters of this effect based on the lifetime of the effect.

T2DParticleEmitter

Particle Emitter. This class cannot be inherited.

Methods

AdvanceEmitterTime(System.Single)

Advance time on all particles in the emitter.
Param(s)dt: Time to advance, in seconds.

ClearParticles

Clear all particles from the particle pool.

CreateParticles(System.Int32)

Create given number of particles.
Param(s)newParticles: Number of particles to generate.

InitializeParticle(GarageGames.Torque.T2D.T2DParticle@)

Initialize given particle.
Param(s)particle: Particle to initialize.

IntegrateParticle(GarageGames.Torque.T2D.T2DParticle@,System.Single)

Update given particle over passed time interval, in seconds.
Param(s)particle: Particle to integrate.
dt: Amount to advance time, in seconds.

PauseEmitter

Stop emitting particles until PlayEmitter is called.

PlayEmitter(System.Boolean)

Start emitter.
Param(s)clearParticles: If true, then clear particles already allocated.

RenderEmitter(GarageGames.Torque.GFX.GFXVertexFormat.PCTTBN[],System.Int16[],System.Int32@,System.Int32@,Microsoft.Xna.Framework.Vector2[],Microsoft.Xna.Framework.Vector4@,Microsoft.Xna.Framework.Vector4@)

Render all the particles in the emitter. This method is called by particle effects and should not normally be called otherwise.
Param(s)vertexScratch: Scratch space for vertices. Must contain enough space for all particles to be rendered.
indexScratch: Scratch space for indices. Must contain enough space for all particles to be rendered.
vertexOffset: Offset into vertex scratch space for first vertex. Will be udpated for later particles.
indexOffset: Offset into index scratch space for first index. Will be udpated for later particles.
textureCoords: Array of texture coords.
normal: Precomputed normal for particle.
binormal: Precomputed binormal for particle.
tangent: Precomputed tangent for particle.

Properties

AllocatedNumber of particles allocated in particle pool. Implements IIndexPoolerChain.Allocated. CurrentEmitterDataCurrent Emitter Data. Determines most of the parameters which effect the generation of particles. HeadIndex of first particle in particle pool. Implements IIndexPoolerChain.Head. TailIndex of last particle in particle pool. Implements IIndexPoolerChain.Tail.

T2DParticleEmitterData

T2DParticleEmitterData describes the type of particles and the lifetime characteristics of particles generated by a particular particle emitter. Note: many of the particle emitter data properties are T2DKeyGraphs. These are keyframe animations of variables over time. There are typically three versions of each variable: base, variation, and life, name, e.g., SizeBase, SizeVariation, and SizeLife. Base determines the center of the range whereas variation determines the full range (+/- half variation). These values are determined once per particle, with emitter lifetime being used as the index. The life keygraph determines a scale value which varies over the lifetime of the particle itself (as opposed to the emitter).

Methods

ResetValues

Reset emitter data values to defaults.

Properties

AttachPositionToEmitterIf true then position of particles is relative to the emitter. As the emitter moves so do the particles. AttachRotationToEmitterIf true then particles will rotate around emitter as it rotates (i.e., "particle space" is "object space"). Note that if this property is true then AttachPositionToEmitter is forced to true. BlueChannelLifeUsed to determine the blue color of particles. EmissionAngleBaseUsed to determine emission angle of particles. Note: if UseEffectEmission then this value is used and values on effect are used instead. EmissionAngleVariationUsed to determine emission angle of particles. Note: if UseEffectEmission then this value is used and values on effect are used instead. EmissionArcBaseUsed to determine emission angle of particles. Note: if UseEffectEmission then this value is used and values on effect are used instead. EmissionArcVariationUsed to determine emission angle of particles. Note: if UseEffectEmission then this value is used and values on effect are used instead. EmissionForceBaseUsed to determine initial velocity when particle is first emitted. Note: if UseEffectEmission then this value is used and values on effect are used instead. EmissionForceVariationUsed to determine initial velocity when particle is first emitted. Note: if UseEffectEmission then this value is used and values on effect are used instead. EmitterAreaSet the area type over which particle emissions will occur. FirstInFrontOrderIf true then older particles are rendered on top of newer particles. Otherwise, oldest particles are rendered underneath newer particles. FixedAreaAspectIf true then when figuring the area of emission for an emitter, the y size will be set to equal the x size. FixedForceAngleSets the angle in degrees of the fixed force applied to each particle. FixedForceBaseUsed to determine strength of force to apply to particle over it's lifetime. FixedForceDirectionThe direction of the fixed force applied to each particle. FixedForceLifeUsed to determine strength of force to apply to particle over it's lifetime. FixedForceVariationUsed to determine strength of force to apply to particle over it's lifetime. FixedParticleAspectIf true, then y size of particle will be set to equalthe x size. GreenChannelLifeUsed to determine the green color of particles. HiddenIf true, don't render emitter. InitialAgeUsed to produce an initial burst of particles. InitialAge is added to initial emitter time when determining how many particles to generate over early time steps. Note that true particle and effect time is still used to determine particle parameters. LinkEmissionRotationIf true then particles will be emitted reltive to parent particle effect. MaterialMaterial used for rendering particles. MaterialNameName of material used for rendering particles. NameName of particle emitter. OrientationAngleOffsetOffset orientation of new particles by this value. OrientationRandomArcUsed to determine random orientation of particles. The random arc is the range of the possible orientations. ParticleLifeBaseUsed to determine the base lifetime for particles. ParticleLifeVariationUsed to determine the base lifetime for particles. ParticleOrientationSet the particle orientation mode. Determines how particles will be oriented when first emitted. ParticlePivotPointPoint about which particles rotate. Note that pivot point is specified in unscaled particle space, so that 0,0 is in center and (1,1), (-1,1), (1,-1), and (-1,-1) are the corners of the particle. QuantityBaseUsed to determine the rate at which particles are emitted (particles/sec). QuantityVariationUsed to determine the rate at which particles are emitted (particles/sec). RandomMotionBaseUsed to determine strength of random motion applied to particle. RandomMotionLifeUsed to determine strength of random motion applied to particle. RandomMotionVariationUsed to determine strength of random motion applied to particle. RedChannelLifeUsed to determine the red color of particles. SingleParticleIf true then only one particle is generated. This is for debug purposes only. SizeXBaseUsed to determine the size of particles along the x dimension. SizeXLifeUsed to determine the size of particles along the x dimension. SizeXVariationUsed to determine the size of particles along the x dimension. SizeYBaseUsed to determine the size of particles along the y dimension. SizeYLifeUsed to determine the size of particles along the y dimension. SizeYVariationUsed to determine the size of particles along the y dimension. SpeedBaseUsed to determine a scale to apply to speed (which is determined from FixedForce and RandomMotion key graphs). SpeedLifeUsed to determine a scale to apply to speed (which is determined from FixedForce and RandomMotion key graphs). SpeedVariationUsed to determine a scale to apply to speed (which is determined from FixedForce and RandomMotion key graphs). SpinBaseUsed to determine rotation rate of particles. SpinLifeUsed to determine rotation rate of particles. SpinVariationUsed to determine rotation rate of particles. UseEffectEmissionIf true the effect rather than emitter is used to determine emission velocity. VisibilityLifeUsed to determine the visibility of particles.

T2DParticleManager

Singleton Particle Manager. Used by particle emitters to generate particles. This class cannot be inherited.

Methods

AllocateParticles(System.Int32,GarageGames.Torque.Util.IIndexPoolerChain)

Allocate a quantity of particles. No initialization occurs.
Param(s)quantity: Number of particles to allocate.
poolerChain: Pooler to allocate from.

FreeAllParticles(GarageGames.Torque.Util.IIndexPoolerChain)

Free all particles withing a given pool.
Param(s)poolerChain: Pool of particles to clear.

FreeParticle(System.Int32,GarageGames.Torque.Util.IIndexPoolerChain)

Free a single particle, removing from linked list.
Param(s)index: Index of particle to free.
poolerChain: Particle pool from which originally allocated.

Properties

AllocatedNumber of particle slots currently in use. CapacityCurrent particle capacity. This is not a hard limit. If number of particles exceeds capacity then more space is allocated. ChunkSizeNumber of new particles slots which will be created if current Capacity is exceeded. FreeNumber of particle slots not currently in used. NodeEndMarkerIndex indicating end of list of particles. PoolPool of all particles.

T2DPhysicsComponent

Adding this component to a T2DSceneObject gives it physics. T2DPhysicsComponent supports rigid body physics as well as simpler physical simulation. Set the ResolveCollision property to determine how the object will respond to collisions.

Methods

ApplyImpulse(Microsoft.Xna.Framework.Vector2,Microsoft.Xna.Framework.Vector2)

Apply an impulse to object at the given offset. Mass and RotationalInertia will be used to determine the result of the impulse. Note that Impulse = Force * Time.
Param(s)impulse: Impulse to apply.
offset: Offset to apply force, in object space.

ApplyImpulse(Microsoft.Xna.Framework.Vector2)

Apply an impulse to object at the center of the object. Mass will be used to determine the result of the impulse. Note that Impulse = Force * Time.

Properties

AngularVelocityCurrent angular (rotational) velocity of SceneObject (in degrees/sec). BounceCollisionIf ResolveCollision is set to this static delegate then collisions will result in a bounce with no rotation. The physics material will be used to determine the amount of bounce. CanMoveIf false, object cannot be moved in a collision with another object. See Immovable for more information. CanRotateTrue if object can be rotated in a collision, false otherwise. Set RotationalScale to 0 to make this property false. Note that if this property is set to false the object can still rotate if AngularRotation is set manually. ClampCollisionIf ResolveCollision is set to this static delegate then collisions will result in removing all velocity into the surface. DefaultCollisionMaterialThe physics material that will be used in all collisions which don't otherwise specify a physics material. ImmovableIf true, object cannot be moved in a collision with another object. Note that object can still move if velocity is set manually. Collisions with this object will then act like collisions against a moving wall. If two immovable objects collide then resolution will be erratic, so this should be avoided. InverseMassInverse mass of SceneObject. Setting this to 0 is same as marking object Immovable. Mass (and InverseMass) is used when responding to collisions and when forces are applied. InverseRotationalInertiaInverse moment of rotational inertia. This affects how easily the object rotates. By default, it is equal to the value expected from a box with uniform distribution of mass. Set RotationalScale to affect this property. KillCollisionIf ResolveCollision is set to this static delegate then collisions will result in Unregister being called on the owning SceneObject. MassMass of object. Mass (and InverseMass) is used when responding to collisions and when forces are applied. ProcessCollisionsAtRestIf true, collisions will be processed even while object is at rest. If false, object with zero velocity and angular velocity will not process collisions. Setting to false can lead to better performance but in some situations can miss collisions. RigidCollisionIf ResolveCollision is set to this static delegate then collisions will be rigid body collisions. The physics material will be used to determine parameters of the collision response. RotationScaleScale the inverse inertia. Default value is 1. RotationalInertiaRotational moment of intertia of SceneObject. See InverseRotationalInertia for more information. SceneObjectOwning T2DSceneObject. StickyCollisionIf ResolveCollision is set to this static delegate then collisions will result in velocity and angular velocity being set to zero. VelocityCurrent velocity of SceneObject. VelocityXX component of current SceneObject velocity. VelocityYY component of current SceneObject velocity.


Methods

_UpdateCollisionPoly

Sets the default collision vertices to be the same as the vertices of the polygon if the polygon is specified as being Collidable.

Properties

CollidableSpecify whether the polygon should be collidable. This is different from just enabling collisions as the vertices that make up the polygon are passed to the collision image. Only works correctly if the polygon is convex. ColorSpecifies the color of the polygon. PrimitiveDefine the polygon by a primitive based on the vertex count For example, 3 would specify an equilateral triangle and 4 would specify a square. VerticesThe list of vertices that will define the polygon in clock-wise order.

T2DPolyImage

Collision image representing a polygon.

Methods

RenderBounds(Microsoft.Xna.Framework.Matrix,GarageGames.Torque.SceneGraph.SceneRenderState)

Render bounds of polygon render image. Typically called from T2DSceneObject.Render.
Param(s)objToWorld: Current render transform.
srs: Scene render state passed in for rendering purposes.

Properties

CollisionPolyPolygon used for collision checking. This is CollisionPolyBasis scaled by SceneObject.Size. CollisionPolyBasisPolygon with coordinates scaled between -1 and 1. Actual polygon used for collision checking can be found using the CollisionPoly property. That polygon is determined from this one by scaling coordinates by SceneObject.Size. CollisionPolyPrimitiveSet this property to create a collision primitive with the given number of vertices. Setting this property will create a symmetrical poly with the given number of sides. CollisionPolyScaleScale collision polygon. UseCollisionBasisRawIf true, CollisionPolyBasis rather than CollisionPoly is used for collision checking.

T2DProcessComponent

Add this component to a T2DSceneObject in order to be able to add simple Processors which perform simple calculations on float ValueInterfaces exposed by other components in their RegisterInterfaces call. Typical usage of a T2DProcessComponent.Processor is to convert game pad input into the rotation of a link point or the strength of a force. In addition to the flexibility the Processor framework provides, the output of a Processor is automatically interpolated during InterpolateTick callbacks.

Methods

AddProcessor(GarageGames.Torque.T2D.T2DProcessComponent.Processor)

Add a new processor. Processors can be added on the fly to adjust how a game object responds depending on game conditions.
Param(s)p: New processor.

Properties

SceneObjectT2DSceneObject which owns the component.

ButtonProcessor

Processor which processes a Move's Button.

LeverProcessor

Processor which processes a Move's Lever.

PolarLengthProcessor

Processor which processes the length of a Move's stick. See also PolarRotationProcessor.

PolarRotationProcessor

Processor which processes the rotation of a Move's stick. See also PolarLengthProcessor.

Processor

Abstract base class for processors which can be added to T2DProcessComponent. This class is and so cannot be instantiated.

Methods

Init(GarageGames.Torque.T2D.T2DSceneObject,System.Single@)

This method called when Processor is first added.
Param(s)sceneObject: T2DSceneObject which owns the T2DProcessComponent.
initialVal: Initial value of the Processor.

Process(GarageGames.Torque.Sim.Move,System.Single,System.Single@)

Processor does it's work in this method. If writing your own Processor this is where you do your thing.
Param(s)move: The move passed into ProcessTick for the object.
dt: The elapsed time, in seconds, passed into ProcessTick for the object.
val: The output value.

StickProcessor

Processor which processes a single axis of a Move's Stick.

TriggerProcessor

Processor which processes a Move's Trigger.

T2DSceneCamera

Scene camera used by T2DSceneGraph.

Methods

AnimatePosition

Begin animating the camera's position using the data specified in the camera's AnimatePositionTarget, AnimatePositionTime, and AnimatePositionMode properties.

AnimatePosition(Microsoft.Xna.Framework.Vector2)

Begin animating the camera's position using the specified values.
Param(s)targetPosition: The desired position to end up at.

AnimatePosition(Microsoft.Xna.Framework.Vector2,System.Single)

Begin animating the camera's position using the specified values.
Param(s)targetPosition: The desired position to end up at.
animationTime: The amount of time in milliseconds to allow the camera to get to the target position.

AnimatePosition(Microsoft.Xna.Framework.Vector2,System.Single,GarageGames.Torque.Util.InterpolationMode)

Begin animating the camera's position using the specified values.
Param(s)targetPosition: The desired position to end up at.
animationTime: The amount of time in milliseconds to allow the camera to get to the target position.
mode: The InterpolateionMode to use when animating the camera's position.

AnimateRotation

Begin animating the camera's rotation using the data specified in the camera's AnimateRotationTarget, AnimateRotationTime, and AnimateRotationMode properties.

AnimateRotation(System.Single)

Begin animating the camera's rotation using the specified values.
Param(s)targetRotation: The desired rotation to end up at.

AnimateRotation(System.Single,System.Single)

Begin animating the camera's rotation using the specified values.
Param(s)targetRotation: The desired rotation to end up at.
animationTime: The amount of time in milliseconds to allow the camera to get to the target rotation.

AnimateRotation(System.Single,System.Single,GarageGames.Torque.Util.InterpolationMode)

Begin animating the camera's rotation using the specified values.
Param(s)targetRotation: The desired rotation to end up at.
animationTime: The amount of time in milliseconds to allow the camera to get to the target rotation.
mode: The InterpolateionMode to use when animating the camera's rotation.

AnimateZoom

Begin animating the camera's zoom using the data specified in the camera's AnimateZoomTarget, AnimateZoomTime, and AnimateZoomMode properties.

AnimateZoom(System.Single)

Begin animating the camera's zoom using the specified values.
Param(s)targetZoom: The desired zoom to end up at.

AnimateZoom(System.Single,System.Single)

Begin animating the camera's zoom using the specified values.
Param(s)targetZoom: The desired zoom to end up at.
animationTime: The amount of time in milliseconds to allow the camera to get to the target zoom value.

AnimateZoom(System.Single,System.Single,GarageGames.Torque.Util.InterpolationMode)

Begin animating the camera's zoom using the specified values.
Param(s)targetZoom: The desired zoom to end up at.
animationTime: The amount of time in milliseconds to allow the camera to get to the target zoom value.
mode: The InterpolateionMode to use when animating the camera's zoom.

ApplyResize(Microsoft.Xna.Framework.Vector2)

Apply the configured camera resize options (ResizeToDisplayAspectRatio or ResizeToDisplayAspectRatioWithFixedWidth) to the specified input vector. The camera will perform this automatically on its extent if one of the above parameters is true. You can also call this function to resize objects. For instance you may have a border image which defines the edge of the viewable area, so this function could be used to resize that image.

CompleteAllAnimation

Immediately stop animating the camera's position, rotation, and zoom and snap any of them that were animating to their respective target values.

CompletePositionAnimation

Immediately stop animating the camera's position and snap to the AnimatePositionTarget position.

CompleteRotationAnimation

Immediately stop animating the camera's rotation and snap to the AnimateRotationTarget rotation.

CompleteZoomAnimation

Immediately stop animating the camera's zoom and snap to the AnimateZoomTarget zoom value.

Properties

AnimatePositionModeThe interpolation mode to use when animating this camera's position. AnimatePositionTargetThe position that the camera should end up at if AnimatePosition is called. AnimatePositionTimeThe time in milliseconds that the camera will take to get to it's target position when AnimatePosition is called. AnimateRotationModeThe interpolation mode to use when animating this camera's rotation. AnimateRotationTargetThe rotation that the camera should end up at if AnimateRotation is called. AnimateRotationTimeThe time in milliseconds that the camera will take to get to it's target rotation when AnimateRotation is called. AnimateZoomModeThe interpolation mode to use when animating this camera's zoom. AnimateZoomTargetThe zoom that the camera should end up at if AnimateZoom is called. AnimateZoomTimeThe time in milliseconds that the camera will take to get to it's target Zoom when AnimateZoom is called. CameraAspectRatioReturn the width to height aspect ratio of the camera's extent. CameraWorldLimitMaxIf UseCameraWorldLimits is true, then camera cannot move outside CameraWorldLimitMin and CameraWorldLimitMax. CameraWorldLimitMinIf UseCameraWorldLimits is true, then camera cannot move outside CameraWorldLimitMin and CameraWorldLimitMax. CenterPositionCenter of screen in world units. ExtentAmount of 2D world to view. Reduce the extent to zoom in and expand the extent to zoom out. Extent and CenterPosition are used to determine SceneMin and SceneMax. IsMovingSpecifies whether or not the camera is currently animating its position. IsRotatingSpecifies whether or not the camera is currently animating its rotation. IsWideScreenReturns true if the camera extent is widescreen, false otherwise. IsZoomingSpecifies whether or not the camera is currently animating its zoom value. ResizeToDisplayAspectRatioIf true the the SceneMin and SceneMax will be scaled to fit the aspect ratio of the current display device. Screen height will be maintained but width will be modified. ResizeToDisplayAspectRatioWithFixedWidthIf true the the SceneMin and SceneMax will be scaled to fit the aspect ratio of the current display device. Screen width will be maintained but height will be modified. SceneMaxMaximum values for the current view area. SceneMinMinimum values for the current view area. UseCameraWorldLimitsIf true, camera cannot move outside CameraWorldLimitMin and CameraWorldLimitMax. WorldViewIndexThe world view index associated with this camera. ZoomThe current zoom level of the camera.

T2DSceneContainer

Scene container used by T2DSceneGraph.

Methods

CheckSceneObjectBinsT2D(GarageGames.Torque.T2D.T2DSceneObject)

Accelerated version of CheckSceneObjectBins for T2D.
Param(s)obj: Object to check.

_FoundObject(GarageGames.Torque.SceneGraph.ISceneContainerObject,GarageGames.Torque.SceneGraph.SceneContainerQueryData)"

Query class for the container system. To do container queries, create an instance of this class, populate its member fields according to how you want to do your query, and then pass the instance to the container's FindObjects method.

T2DSceneGraph

SceneGraph used by T2D.

Methods

FindObjects(GarageGames.Torque.MathUtil.RectangleF,GarageGames.Torque.Core.TorqueObjectType,System.UInt32,System.Collections.Generic.List{GarageGames.Torque.SceneGraph.ISceneContainerObject})

Find objects in scene container within the given search rectangle and matching the specified object types and layers.
Param(s)searchRect: World rectangle to search.
findTypes: Object types to match.
layerMask: Layers to match.
list: List which will contain results. Note: list is not cleared.

FindObjects(Microsoft.Xna.Framework.Vector2,System.Single,GarageGames.Torque.Core.TorqueObjectType,System.UInt32,System.Collections.Generic.List{GarageGames.Torque.SceneGraph.ISceneContainerObject})

Find object in scene container within the given search radius and matching the specified object type and layers.
Param(s)pos: Center of search radius.
radius: Radius of search.
findTypes: Object types to match.
layerMask: Layers to match.
list: List which will contain results. Note: list is not cleared.

UpdateObjectT2D(GarageGames.Torque.T2D.T2DSceneObject)

An accelerated version of UpdateUpdate for T2DSceneObjects.
Param(s)obj: T2DSceneObject to update.

Properties

LayerSortDictionaryThe T2DLayerSortDictionary can be used to control how the objects in each layer are sorted for rendering. See T2DLayerSortDictionary for pre-defined methods for sorting layers or provide a custom method. Add a sort method to a layer using the Add method on the dictionary with the layer as a key and the sort method as the value. UseDepthBufferThis will not work correctly with T2DShape3D objects.

T2DSceneObject

Object which provides basic functionality for 2D game objects. T2DSceneObjects can be added to a T2DSceneGraph, can be mounted to other T2DSceneObjects, and can be modified by adding a number of built in components. In particular, to add collision checking add a T2DCollisionComponent, to add physics add a T2DPhysicsComponent, and to add the ability to hold link points add a T2DLinkPointComponent.

Methods

Dismount

Dismount this object from whatever object it is mounted to. If not mounted then this method will do nothing.

GetMountPosition(Microsoft.Xna.Framework.Vector2@,System.Single@)

Return the position that the object is mounted to. In the case of force mount the object moves toward this position. Otherwise the object snaps to the position.
Param(s)position: Position of mount.
rotation: Rotation of mount.

GetMountedObject(System.String)

Finds the object mounted to this object using the given link point name.
Param(s)name: Name of link point used to mount searched for object. Wildcards are allowed in name.

GetMountedObjects(System.String,System.Collections.Generic.List{GarageGames.Torque.T2D.T2DSceneObject})

List of objects mounted to this object which match name. Wildcards can be used in name, so "*" will return all mounted objects.
Param(s)name: Name of link point used to mount searched for objects. Wildcards are allowed in name.
list: List to add mounted objects to.

GetRootMountee

Return the top level mountee for a given object or null if not mounted.

GetWorldLinkPosition(Microsoft.Xna.Framework.Vector2,System.Single,Microsoft.Xna.Framework.Vector2)

Find offset from a link point in world coordinates. Link point is specified with link point position and rotation. Position is in normalized object coordinates (i.e., -1,-1 is lower left, +1,+1 is upper right). Rotation is specified in degrees.
Param(s)linkPos: Position of link point in normalized object coordinates.
linkRot: Rotation of link point in degrees.
offset: Offset from link point. This value will be rotated by link point rotation.

GetWorldLinkPosition(GarageGames.Torque.Core.ValueInterface{Microsoft.Xna.Framework.Vector2},GarageGames.Torque.Core.ValueInterface{System.Single},Microsoft.Xna.Framework.Vector2)


Param(s)linkPosInterface: TorqueInterface to link position in normalized object coordinates.
linkRotInterface: TorqueInterface to link rotation in degrees.
offset: Offset from link point. This value will be rotated by link point rotation.

GetWorldLinkRotation(System.Single,System.Single)

Find world-space rotation of a link point, offset by rotOffset.
Param(s)linkRot: Rotation of link point (in object space).
rotOffset: Rotation offset from link point.

GetWorldLinkRotation(GarageGames.Torque.Core.ValueInterface{System.Single},System.Single)


Param(s)linkRotInterface: TorqueInterface to link rotation in degrees.
rotOffset: Rotation offset from link point.

Mount(GarageGames.Torque.T2D.T2DSceneObject,System.String,Microsoft.Xna.Framework.Vector2,System.Single,System.Boolean)

Mount this object onto another object. If a link point name is passed the object will be mounted to the named link point if it exists. If the link point doesn't exist it will be mounted to the object as if no name was provided, except that it can still be found via GetMountedObject.
Param(s)mountee: Object to mount onto.
linkPointName: Name of link point.
offset: Offset from linkpoint in link space (or object space if no linkpoint).
rotationOffset: Offset rotation from linkpoint.
ownedByMount: True if this object should be unregistered when mountee is unregistered.

Mount(GarageGames.Torque.T2D.T2DSceneObject,System.String,System.Boolean)

Mount this object onto another object. If a link point name is passed the object will be mounted to the named link point if it exists. If the link point doesn't exist it will be mounted to the object as if no name was provided, except that it can still be found via GetMountedObject.
Param(s)mountee: Object to mount onto.
linkPointName: Name of link point.
ownedByMount: True if this object should be unregistered when mountee is unregistered.

SetPosition(Microsoft.Xna.Framework.Vector2,System.Boolean)

Changes position of object optionally updating spatial data. Use this method with updateSpatialdata=false rather than Position property if you have several updates to make to the object in order to save unneeded calls to UpdateSpatialData. However, UpdateSpatialData must be called in the end or else the scene container may have old data.
Param(s)pos: New position
updateSpatialdata: True if spatial data should be updated.

SetRotation(System.Single,System.Boolean)

Changes rotation of object optionally updating spatial data. Use this method with updateSpatialdata=false rather than Rotation property if you have several updates to make to the object in order to save unneeded calls to UpdateSpatialData. However, UpdateSpatialData must be called in the end or else the scene container may have old data.
Param(s)rot: New rotation
updateSpatialdata: True if spatial data should be updated.

SetTicking

Registers object with process list to receive tick callbacks if not already registered. It is generally not necessary to call this method because the object will call this method when needed.

SnapToMount

Move object to the mount location if it is mounted to another object.

StartTick

Begin a tick if not already begun. This method insures that any changes in position or rotation are recorded as movements during this tick and not the last tick. This method should be called by any component which changes position during a tick.

UpdateSpatialData

Updates spatial data held by scene graph if position or rotation has changed since last time the method was called.

WarpToPosition(Microsoft.Xna.Framework.Vector2,System.Single)

Move scene object and all mounted objects to new position and rotation without interpolation. This method should be used if an object is being moved large distances (e.g., when re-spawning player). WarpToPosition is called during OnRegister so if the Position and Rotation properties are used before the object is registered there will be no interpolation and mounted objects will be properly moved. Note: mounted objects normally udpate their position during their own tick, but calling WarpToPosition will move them immediately (necessary for certain cases).
Param(s)pos: New position.
rot: New rotation.

Properties

CollisionCollision component for scene object, or null if it doesn't have one. CollisionsEnabledTrue if collisions are enabled on the object. Even if collisions are enabled, object also needs to have a collision component and the collision component needs to have a collision image. CreateWithCollisionTrue if object should be created with collision component. This property is true by default. CreateWithLinkPointsTrue if object should be created with link points component. This property is false by default. CreateWithPhysicsTrue if object should be created with physics component. This property is true by default. CreateWithWorldLimitTrue if object should be created with world limit component. This property is false by default. FlipXDraw object with x-axis flipped. FlipYDraw object with y-axis flipped. InSceneContainerTrue if object has been added to the scene graph and scene container. InheritMountFlipTrue if object's FlipX and FlipY properties should match the object mounted to. InheritMountVisibilityTrue if object's Visible and VisibilityLevel properties should match the object mounted to. IsMountedTrue if scene object is mounted to another scene object. IsOwnedByMountTrue if scene object is owned by object it is mounted to. If an object is owned by another object then it will be unregistered when that object is unregistered. LayerLayer to draw scene object on. Lower numbered layers are drawn on top. LayerDepthObject is drawn at this z coordinate when rendering. This is a function of Layer and is used for rendering purposes only. LayerMaskLayerMask is used for collision checking. The layer mask is determined by setting the bit corresponding with the layer (layers outside the range of 0..31 are treated as Layer % 32). LayerOrderOrder of object within a layer. This is a read-only property used when rendering to make sure objects are rendered in the same order from frame to frame. LinkPointsLink point component for scene object, or null if it doesn't have one. Note: link point component is not cached on object, so this property causes a component lookup. MountForceValue of mount force, if UseMountForce is true. Mount force is used to move an object towards mount point rather than snapping directly onto the mount point each update. The units for mount force are arbitrary, with larger values resulting in tighter tracking. A value of 1 means it will take about 1 second to snap into place. A value of 2 means it will take about 1/2 seconds, etc. MountedToObject which current object is mounted to, or null if not mounted. PhysicsPhysics component for scene object, or null if it doesn't have one. PositionPosition of scene object. Setting this property after the object has been registered will cause it to interpolate between current position and new position. In order to make an object move to a new position without interpolation use WarpToPosition method. RotationRotation of scene object. Setting this property after the object has been registered will cause it to interpolate between current rotation and new rotation. In order to make an object move to a new rotation without interpolation use WarpToPosition method. SceneGraphThe scenegraph associated with this scene object. SizeSize in world units of scene object. SortPointThe reference point for sorting a scene objects within a layer. TickInProgressTrue if StartTicking has been called this tick. It is not generally needed to check this property. If a component requires the object to have already started it's tick (e.g., if it changes the position of the object) then call StartTicking whether or not tick is already in progress. TickStartedTrue if scene object has registered it's tick callbacks with the process list. Set to true when SetTicking is called. SetTicking needs only be called once on an object and the object will receive tick callbacks. Normally T2DSceneObject handles whether or not to call SetTicking and user does not need to. TrackMountRotationTrue if scene object tracks rotation of object mounted to. If the object was mounted with a link point the link rotation will be added in. If the mount has a rotation offset then it will be added too. UseMountForceTrue if uses mount force (MountForce property must be non-zero for this to have an effect). VisibilityLevelSets alpha blend value to control the degree of visibility. If Visible property is false then object is not visible no matter what this value is. VisibleTrue if visible. Collisions are also disabled if not visible. WorldClipRectangleWorld-space rectangle bounding our object. WorldCollisionClipRectangleWorld-space rectangle bounding our object. WorldLimitWorld limit component for scene object, or null if it doesn't have one.

AddThread(System.String,System.String,System.Boolean)

Adds a new animation thread to the shape and optionally sets a sequence to play on it.
Param(s)threadName: The case sensitive name of the animation thread.
startSequence: The case sensitive sequence name or null if no sequence should be played.
autoAdvance: If true the thread will be automatically advanced during the animation update.

GetSequenceName(System.String)

Returns the name of the sequence playing on a thread.
Param(s)threadName: The case sensitive name of the animation thread.

GetThreadPosition(System.String)

Gets the position of the current sequence on a thread.
Param(s)threadName: The case sensitive name of the animation thread.

GetThreadTimeScale(System.String)

Returns the current time scale for a thread or 0 if the shape or thread has not been created.
Param(s)threadName: The case sensitive name of the animation thread.

IsInTransition(System.String)

Returns true if a transition is in progress on the named thread.
Param(s)threadName: The case sensitive name of the animation thread.

IsSequencePlaying(System.String,System.String)

Returns true if the sequence is playing on the named thread.
Param(s)threadName: The case sensitive name of the animation thread.
sequence: The case sensitive sequence name to set.

IsShapeMounted

Returns true if this shape is mounted on to another shape.

LoadSequence(System.String,System.String)

Loads a DSQ animation sequence file.
Param(s)dsqFilePath: The path to the DSQ file.
sequenceName: An optional name for the sequence or null to use the default.

MountShape(GarageGames.Torque.T2D.T2DShape3D,System.String)

Mounts another shape object on to this shape at a node. The mountee will be unregistered to remove it from the scene graph.
Param(s)mountee: The shape to mount.
node: The case sensitive node name at which to mount the shape.

SetSequence(System.String,System.String,System.Single)

Immediately starts a sequence on the named thread.
Param(s)threadName: The case sensitive name of the animation thread.
sequenceName: The case sensitive sequence name to set.
pos: The 0 to 1 position to start playback within the sequence.

SetShape(System.String)

Sets the DTS shape for this object to render.
Param(s)shapeFile: The path to the DTS file.

SetThreadTimeScale(System.String,System.Single)

Scales the speed of animation playback for a thread.
Param(s)threadName: The case sensitive name of the animation thread.
scale: A positive scale factor.

TransitionToSequence(System.String,System.String,System.Single,System.Single,System.Boolean)

Plays a new sequence on the named thread transitioning from the currently playing sequence by interpolating between frames.
Param(s)threadName: The case sensitive name of the animation thread.
sequenceName: The case sensitive sequence name to transition to.
pos: The 0 to 1 position to start playback within the sequence.
duration: The positive, non-zero, duration in seconds to take for the transition.
continuePlay: If true the sequence will continue to play after the transition is complete.

UnmountAllShapes

Unmounts all shapes mounted to this one.

UnmountShape(GarageGames.Torque.T2D.T2DShape3D)

Unmounts a shape from this shape. The unmounted shape is in an unregistered state.
Param(s)mountee: The shape which was previously mounted to this shape.
DetailLevelThe level of detail to render. The value is clamped to the range of detail levels within the shape. DetailLevelsReturns the number of detail levels in the loaded shape or zero if no shape is loaded. IntraDetailLevelThis is a fractional value that sets the percentage between the current detail level and the next. MountedToShapeT2DShape3D to mount this shape to. See MountShape method. ShapeShape to render. This can be set by loading a dts file (see SetShape method). ShapeFileThis is normaly only used from serialization to assign a shape file to this shape object. ShapeMatrixThis matrix is applied to the shape before it is positioned, scaled, and rendered. It is generally used to set the orientation of the shape. ShapeScaleApply scale to shape when rendering.

T2DSizeAnimComponent

Add this component to a T2DSceneObject to animate it's size property.

Methods

ResetAnimation

Start animation over, setting size to the original starting size.

Properties

AnimationRateRate of animation in X and Y MaxSizeMaximum size of animation. MinSizeMinimum size of animation. The minimum size of any object is zero. PingPongAnimationTrue if animation is a ping pong animation (goes back and forth between minimum and maximum).

T2DSpawnObject

Creates a copy of the SpawnTemplate object and adds it to the scene. Can be used in one of two ways. If SpawnOnce is specified, on OnRegister it will remove itself after creating one object from the SpawnTemplate. This can be used to place many copies of the same object in the scene at startup. Otherwise T2DSpawnObject will continue to place copies of the SpawnTemplate into the scene based on the given SpawnTime and SpawnVariance. Position, Rotation, and Size of the spawned object will be over-written with the Position, Rotation, and Size of the T2DSpawnObject.

GetCollisionMatches(Microsoft.Xna.Framework.Vector2,Microsoft.Xna.Framework.Vector2)

Get a list of all possible collision matches given a min and max position within the tile layer.
Param(s)min: Minimum position.
max: Maximum position.

GetTileByGridCoords(System.Int32,System.Int32)

Find a tile by grid (x,y) coordinates.
Param(s)x: Position, in grid (x,y) coordinates.
y: Position, in grid (x,y) coordinates.

PickTile(Microsoft.Xna.Framework.Vector2)

Find a tile by world coordinates.
Param(s)worldPos: Position, in world coordinates.

SetTileByGridCoords(System.Int32,System.Int32,GarageGames.Torque.T2D.T2DTileObject)

Sets the tile at the specified grid coordinates.
Param(s)x: Position, in grid (x,y) coordinates.
y: Position, in grid (x,y) coordinates.
tile: The tile object to insert into the tile layer at the specified grid coordinates.

Clone

Clones this object.

GetTileLocalPosition(Microsoft.Xna.Framework.Vector2,Microsoft.Xna.Framework.Vector2)

Find position of tile in local tile layer space (center of tile map is origin).
Param(s)mapSize: Dimensions of the tile layer.
tileSize: Size of each tile in the tile layer.

GetTileLocalPosition(GarageGames.Torque.T2D.T2DTileLayer)

Find position of tile in local tile layer space (center of tile map is origin).
Param(s)tileLayer: Tile layer which owns this tile.

GetWorldPosition(GarageGames.Torque.T2D.T2DTileLayer)

Find world position of tile assuming it belongs to passed tile layer.
Param(s)tileLayer: Tile layer which owns this tile.

GetWorldPosition(Microsoft.Xna.Framework.Vector2,System.Single,Microsoft.Xna.Framework.Vector2,Microsoft.Xna.Framework.Vector2)

Find world position of tile assuming it belongs to tile layer with the specified parameters.
Param(s)mapPos: Position of the tile layer in world coordinates.
mapRotation: Rotation of the tile layer in degrees.
mapSize: Dimensions of the tile layer.
tileSize: Size of each tile in the tile layer.
DefaultTileTypeReference to T2DTileType to serve as the default tile type if no type is specified for a given position within the TileLayer. MapSizeSize of the TileLayer in tile units. RenderCollisionBoundsSpecifies whether or not to render debug bounds for each tile type within the layer. TileDefinitionsString used to hold deserialized tile definition array. Post-deserialization, this string is not used. TileSizeSize of individual tiles in world units. TileTypesList containing the layer's tile types. FlipXFlip this tile along X axis? FlipYFlip this tile along Y axis? GridPositionPosition of the tile on the grid map of the tile layer. TileTypeT2DTileType of this tile. TileTypeIndexIndex of tile type. Can be used to identify tile in xml representation of tilemap. TileTypeNameName of tile type. Can be used to identify tile in xml representation of tilemap.

T2DTriggerComponent

Adding this component to a T2DSceneObject allows you to receive callbacks when an object enters, stays in, and exits the scene object's bounding box. You can specify the object types to check for with the CollidesWith property, or what layers to check on with the LayerMask property. You can also optionally specify a T2DCollisionImage for the trigger to use in addition to the initial bounding box check. Note that the initial check is still limited to the bounding box of the owning scene object.

Methods

InstallImage(GarageGames.Torque.T2D.T2DCollisionImage)

Installs a collision image on the trigger.
Param(s)image: Reference to the T2DCollisionImage to be installed.

RemoveImage(GarageGames.Torque.T2D.T2DCollisionImage)

Removes a collision image from the trigger.
Param(s)image: Reference to the T2DCollisionImage to be removed.

Properties

CollidesWithDetermines which object types (see T2DSceneObject.ObjectType property) to include in the check. TorqueObjectTypes can be combined to form a collection of object types with which to collide. EnabledSpecifies whether or not the trigger will check for objects. Disabling and re-enabling a trigger clears the trigger's object list, meaning that you will get enter callbacks for all objects that were still in the trigger. IgnoreCollCompNullWhenImgsSpecifies whether or not to include objects without collision components in the case that the trigger has a collision image. A value of true results in the trigger ignoring such objects. A value of false results in the trigger including them without performing a collision image check against the object. This field is ignored if the trigger doesn't have any collision images. ImagesRead only array of collision images. LayerMaskMask which determines which layers will be checked by the trigger. The layer of an object is determined by the T2DSceneObject.Layer property. Because this is a mask, each bit refers to a single layer, with bit N corresponding to layer N. A mask of 7, for example, indicates that the object will collide with objects on layers 1, 2, and 3. OnEnterThis delegate is called when an object enters the trigger. OnLeaveThis delegate is called when an object leaves the trigger. OnStayThis delegate is called every tick that an object stays in the trigger after the initial entry. SceneObjectThe owning T2DSceneObject. SceneObject is used to determine the extent of the trigger region using the T2DSceneObject.Size property.

T2DVectorUtil

Static utility methods for converting between rotation (in degrees) and Vector2. These methods take T2D conventions into consideration (e.g., up is 0 degrees rotation and up depends on whether screen coordinates or input coordinates are being used). This is a and so cannot be inherited or instantiated.

Methods

AngleFromInput(Microsoft.Xna.Framework.Vector2)

Calculate the clockwise angle from analog stick input. Positive y-axis (0,1) is 0 degrees rotation, so an object drawn with the returned rotation will have it's top pointing in the direction of the input stick (note: in T2D -y is up but on the thumbstick +y is up). Return value is in degrees.
Param(s)inputVector: The input vector.

AngleFromTarget(Microsoft.Xna.Framework.Vector2,Microsoft.Xna.Framework.Vector2)

Calculate clockwise angle of vector between two points. Negative y-axis (0,-1) is 0 degrees rotation, so an object drawn with the returned rotation will have it's top pointing from the source position to the target position (note: in T2D -y is up). Return value is in degrees.
Param(s)srcPos: Source position.
targetPos: Target position.

AngleFromVector(Microsoft.Xna.Framework.Vector2)

Calculate the clockwise angle from an offset vector assuming T2D coordinates. Negative y-axis (0,-1) is 0 degrees rotation, so an object drawn with the returned rotation will have it's top pointing along the vector (note: in T2D -y is up). Return value is in degrees.
Param(s)vector: Offset vector.

VectorFromAngle(System.Single)

Calculate vector pointing in the given angle. Angle is in clockwise degrees from "up" (negative y -- (0,-1) -- is up).
Param(s)rotation: Rotation in degrees.

VelocityFromInput(Microsoft.Xna.Framework.Vector2,Microsoft.Xna.Framework.Vector2)

Convert a vector from an input stick into a velocity. Converts from "plus y-up" space of input controller to "minus y-up" screen space.
Param(s)inputVector: The input stick vector.
speedVector: Scale of velocity vector.

VelocityFromTarget(Microsoft.Xna.Framework.Vector2,Microsoft.Xna.Framework.Vector2,System.Single)

Convert an offset vector to a velocity which will move toards the target at the given speed.
Param(s)srcPos: Source position.
targetPos: Target position.
speedScale: Target speed.

T2DWorldLimitComponent

Add this component to a T2DSceneObject to limit the range over which it can move.

Methods

ResolveWorldLimitCollision(GarageGames.Torque.T2D.T2DCollisionInfo)

Resolve world limit collision. Typically called by T2DPhysicsComponent.
Param(s)info: Current collision information.

TestMove(System.Single@,GarageGames.Torque.MathUtil.RectangleF,Microsoft.Xna.Framework.Vector2,GarageGames.Torque.T2D.T2DCollisionComponent,System.Collections.Generic.List{GarageGames.Torque.T2D.T2DCollisionInfo})

Test to see if SceneObject can move from current position along given velocity for given amount of time without colliding with world limits.
Param(s)dt: Duration to move object, in seconds.
searchBox: Box containing entire swept path of object bounds. Used to short cut world bounds check.
velocity: Velocity of object.
collider: Collision component of object.
collisions: List of collisions encountered during move.

TestMove(System.Single@,Microsoft.Xna.Framework.Vector2,System.Collections.Generic.List{GarageGames.Torque.T2D.T2DCollisionInfo})

Test to see if SceneObject can move from current position along given velocity for given amount of time without colliding with world limits.
Param(s)dt: Duration to move object, in seconds.
velocity: Velocity of object.
collisions: List of collisions encountered during move.

Properties

MoveLimitMaxThe maximum coordinates the T2DSceneObject can move to. MoveLimitMinThe minimum coordinates the T2DSceneObject can move to. OnWorldLimitDelegate called when the move limit is reached. SceneObjectThe owning T2DSceneObject. WorldLimitResolveCollisionThe resolve collision delegate to use if the T2DSceneObject collides against the move limit.

T2DCollisionInfo

Information about a collision.

ForceInstance

Instance data for a force.

T2DParticle

Particle.

IKeyGraph

IKeyGraph Interface. This interface is used to provide all properties/methods required to administer a KeyGraph interface.

IT2DForceGenerator

Interface for providing forces to the T2DPhysicsComponent. The interface should be exposed using a TorqueInterfaceWrap during a components RegisterInterfaces call using an interface type name of "force".

Methods

PostUpdateForces(GarageGames.Torque.Sim.Move,System.Single)

Update force after movement. Force should act directly on the T2DSceneObject velocity and angular velocity.
Param(s)move: Move passed into ProcessTick.
dt: Delta time, in seconds.

PreUpdateForces(GarageGames.Torque.Sim.Move,System.Single)

Update force before movement. Force should act directly on the T2DSceneObject velocity and angular velocity.
Param(s)move: Move passed into ProcessTick.
dt: Delta time, in seconds.

EffectLifeMode

Life cycle parameters for particle effect.

EmitterAreaType

Emitter Area Type.

ParticleOrientationMode

Particle Orientation Mode. Determines how particles will be oriented when first emitted.

ProcessMode

Enum for determine which of several potential operations to perform on input.

OnAnimationEndDelegate

Delegate to specify an event when the animation has ended.

OnFrameChangeDelegate

Delegate to specify events when frames changes, passes along the index of the last frame.

T2DOnCollisionDelegate

Called whenever a genuine collision occurs. The resolve delegate passed in will be the default resolve delegate. Do not call it from inside the T2DOnCollisionDelegate. Instead, if you wish to use a different resolve delegate then set the new one on exit. Similarly, the passed T2DCollisionMaterial can be replaced inside the T2DOnCollisionDelegate.

OnAnimateShapeDelegate

Assign this delagate to do your own animation work like switching sequences and controlling threads.

OnAnimationTriggerDelegate

When a trigger event occurs in one of the shapes trigger channels, this callback is fired.

T2DTestCollisionEarlyOutDelegate

Test whether collision checking should continue between the two objects. This should only be used between two objects which sometimes collide and sometimes don't. If two objects never collide, use the CollidesWith property.

T2DTriggerComponentOnEnterDelegate

Called when an object enters the trigger.

T2DTriggerComponentOnLeaveDelegate

Called when an object leaves the trigger.