Unit CastleTransform

Description

Group and transform 3D scenes (TCastleTransform).

Uses

Overview

Classes, Interfaces, Objects and Records

Name Description
Class ECannotAddToAnotherWorld  
Class ETransformParentUndefined  
Class EMultipleReferencesInWorld  
Class ENotAddedToWorld  
Class EPhysicsError  
Class TBaseShadowVolumeRenderer Shadow volumes helper, not depending on OpenGL.
Object TRayCollisionNode Information about ray collision with a single 3D object.
Class TRayCollision Represents a ray collision with a 3D objects tree.
Object TCollisionDetailsItem Detailed information about collision with a single 3D object.
Class TCollisionDetails Represents a collision with a 3D objects tree.
Record TRenderStatistics Statistics about what was rendered during last frame.
Class TPrepareParams Information that a TCastleTransform object needs to prepare rendering.
Class TRenderParams Information that a TCastleTransform object needs to render.
Class TCastleTransformList List of TCastleTransform instances.
Class TCastleTransform Group and transform (move, rotate, scale) children objects.
Class TSceneManagerWorld 3D world.
Class TCollider Shape used for collision detection of a rigid body TRigidBody.
Class TPlaneCollider Collide as an infinite plane.
Class TBoxCollider Collide as a box.
Class TSphereCollider Collide as a sphere.
Class TRigidBody Rigid body properties for the physics engine, see TCastleTransform.RigidBody.

Functions and Procedures

procedure TransformMatricesMult(var Transform, InverseTransform: TMatrix4; const Center: TVector3; const Rotation: TVector4; const Scale: TVector3; const ScaleOrientation: TVector4; const Translation: TVector3);

Types

TCastleTransformClass = class of TCastleTransform;
TRenderFromViewFunction = procedure of object;
TVisibleChange = (...);
TVisibleChanges = set of TVisibleChange;
TVisibleChangeEvent = procedure (const Sender: TCastleTransform; const Changes: TVisibleChanges) of object;
TPrepareResourcesOption = (...);
TPrepareResourcesOptions = set of TPrepareResourcesOption;
PRayCollisionNode = ˆTRayCollisionNode;
PCollisionDetailsItem = ˆTCollisionDetailsItem;
TRenderingPass = 0..1;
TRemoveType = (...);
TOrientationType = (...);
T3DCoord = 0..2;
T3DCoords = set of T3DCoord;

Description

Functions and Procedures

procedure TransformMatricesMult(var Transform, InverseTransform: TMatrix4; const Center: TVector3; const Rotation: TVector4; const Scale: TVector3; const ScaleOrientation: TVector4; const Translation: TVector3);

Apply transformation to a matrix. Calculates at the same time transformation matrix, and it's inverse, and multiplies given Transform, InverseTransform appropriately. The precise meaning of Center, Translation and such parameters follows exactly the X3D Transform node definition (see http://www.web3d.org/files/specifications/19775-1/V3.2/Part01/components/group.html#Transform ).

Parameters
Rotation
Rotation is expressed as a 4D vector, in which the first 3 components specify the rotation axis (does not need to be normalized, but must be non-zero), and the last component is the rotation angle in radians.

Types

TCastleTransformClass = class of TCastleTransform;
 
TRenderFromViewFunction = procedure of object;
 
TVisibleChange = (...);

Describe what visible thing changed for TCastleTransform.VisibleChangeHere.

Values
  • vcVisibleGeometry: Visible geometry (actual 3D shape) changed. It's not used when only light conditions, materials, textures and such changed.

    In practice, this means that the depth buffer from some point in space changed. Which means that shadow maps should be regenerated.

  • vcVisibleNonGeometry: Something visible, but not the geometry shape, changes. For example, material or texture on a visible surface changed.
TVisibleChanges = set of TVisibleChange;
 
TVisibleChangeEvent = procedure (const Sender: TCastleTransform; const Changes: TVisibleChanges) of object;
 
TPrepareResourcesOption = (...);

Various things that TCastleTransform.PrepareResources may prepare.

Values
  • prRender
  • prBackground
  • prBoundingBox
  • prShadowVolume
  • prSpatial: Prepare octrees (determined by things like TCastleSceneCore.Spatial).
  • prScreenEffects
TPrepareResourcesOptions = set of TPrepareResourcesOption;
 
PRayCollisionNode = ˆTRayCollisionNode;
 
PCollisionDetailsItem = ˆTCollisionDetailsItem;

Triangle: PTriangle;

TRenderingPass = 0..1;
 
TRemoveType = (...);
 
Values
  • rtNone
  • rtRemove
  • rtRemoveAndFree
TOrientationType = (...);

Orientation of the model is 3D world, determining where is the conceptual "up" direction of the model, and where is it facing. Used by the TCastleTransform.Orientation and TCastleTransform.DefaultOrientation.

Values
  • otUpYDirectionMinusZ: Orientation sensible for models oriented around Y axis. That is when gravity pulls in -Y and GravityUp vector is +Y. Transformation makes -Z and +Y match (respectively) Direction and Up.

    This matches default direction/up of OpenGL and VRML/X3D cameras.

    For example, using this value for TCastleTransform.Orientation (or even TCastleTransform.DefaultOrientation) is sensible if you use default Blender X3D exporter, and you let the exporter to make a transformation (to make +Z up into +Y up). This is the default setting. Then you can follow the standard Blender view names ("front", "top" and such) when modelling, and Blender tools like "X-axis mirror" will work best.

  • otUpZDirectionMinusY: Orientation sensible for models oriented around Z axis. Transformation makes -Y and +Z match (respectively) Direction and Up.

    Using this value for TCastleTransform.Orientation (or even TCastleTransform.DefaultOrientation) is sensible if you export your models from Blender without transforming them during export. Note that this is not the default Blender X3D exporter behavior. But you can configure the exporter to work like this (not transform), and then you can follow the standard Blender view names ("front", "top" and such) when modelling.

  • otUpZDirectionX:

    Warning: this symbol is deprecated.

    Up in +Z (like otUpZDirectionMinusY) and direction in +X. Should not be used in new models.
T3DCoord = 0..2;
 
T3DCoords = set of T3DCoord;
 

Generated by PasDoc 0.15.0.