Castle Game Engine: Castle3D

# Unit Castle3D
Description | Uses | Classes, Interfaces, Objects and Records | Functions and Procedures | Types | Constants | Variables
## Description Base 3D objects (T3D, T3DList, T3DTransform, T3DOrient, T3DMoving). ## Uses SysUtils Classes Math CastleVectors CastleFrustum CastleBoxes CastleClassUtils CastleKeysMouse CastleRectangles CastleUtils FGL CastleGenericLists CastleTimeUtils CastleSoundEngine CastleSectors CastleCameras CastleTriangles ## Overview ### Classes, Interfaces, Objects and Records
Name | Description
--- | ---
Class `TBaseShadowVolumeRenderer` | Shadow volumes helper, not depending on OpenGL.
Object `TRayCollisionNode` | Information about ray collision with a single 3D object.
Class `TRayCollision` | Represents a collision with a 3D objects (T3D descendants) tree.
record `TRenderStatistics` | Statistics about what was rendered during last frame.
Class `TRenderParams` | Information that 3D object needs to render.
Class `T3D` | Base 3D object, that can be managed by TCastleSceneManager.
Class `T3DListCore` | List of 3D objects (T3D instances).
Class `T3DList` | List of 3D objects (T3D instances), that can be treated like another, larger 3D object.
Class `T3DWorld` | 3D world.
Class `T3DCustomTransform` | Transform (move, rotate, scale) other T3D objects.
Class `T3DTransform` | Transform (move, rotate, scale) other T3D objects.
Class `T3DOrient` | Transform other 3D objects by changing their orientation.
Class `T3DMoving` | 3D object moving and potentially pushing other 3D objects.
Class `T3DLinearMoving` | 3D moving with constant speed between 2 points.
Class `T3DAlive` | Alive, oriented 3D object.
### Functions and Procedures
`procedure TransformMatricesMult(var Transform, TransformInverse: TMatrix4Single; const Center: TVector3Single; const Rotation: TVector4Single; const Scale: TVector3Single; const ScaleOrientation: TVector4Single; const Translation: TVector3Single);`
### Types
`TRenderFromViewFunction = procedure of object;`
`TVisibleChange = (...);`
`TVisibleChanges = set of TVisibleChange;`
`TVisibleChangeEvent = procedure (Sender: T3D; Changes: TVisibleChanges) of object;`
`TPrepareResourcesOption = (...);`
`TPrepareResourcesOptions = set of TPrepareResourcesOption;`
`PRayCollisionNode = ˆTRayCollisionNode;`
`TAbstractLightInstancesList = TFPSList;`
`TRenderingPass = 0..1;`
`TRemoveType = (...);`
`TOrientationType = (...);`
`T3DExistsEvent = function(const Item: T3D): boolean of object;`
### Constants
`MaxSingle = Math.MaxSingle;`
`DefaultFallMinHeightToDamage = 5.0;`
`DefaultFallDamageScaleMin = 0.8;`
`DefaultFallDamageScaleMax = 1.2;`
`DefaultCreatureFallMinHeightToSound = 1.0;`
`DefaultPlayerFallMinHeightToSound = 4.0;`
`DefaultCreatureFallSoundName = 'creature_fall';`
`DefaultPlayerFallSoundName = 'player_fall';`
`DirectionFromOrientation: array [TOrientationType] of TVector3Single = ( (0, 0, -1), (0, -1, 0), (1, 0, 0) );`
`UpFromOrientation: array [TOrientationType] of TVector3Single = ( (0, 1, 0), (0, 0, 1), (0, 0, 1) );`
### Variables
`RenderDebug3D: boolean = false;`
`RenderDebugCaptions: boolean = false;`
`LogShadowVolumes: boolean = false;`
## Description ### Functions and Procedures
`procedure TransformMatricesMult(var Transform, TransformInverse: TMatrix4Single; const Center: TVector3Single; const Rotation: TVector4Single; const Scale: TVector3Single; const ScaleOrientation: TVector4Single; const Translation: TVector3Single);`
Apply transformation to a matrix. Calculates at the same time transformation matrix, and it's inverse, and multiplies given Transform, TransformInverse 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 ).
### Types
`TRenderFromViewFunction = procedure of object;`
`TVisibleChange = (...);`
Describe what visible thing changed for T3D.VisibleChangeHere. ###### Values vcVisibleGeometry: Something visible in the geometry changed. "Geometry" means that this is applicable only to actual 3D shape changes. (Think about "does depth buffer from some point in space changes" — this is actually why we have separate vcVisibleGeometry and vcVisibleNonGeometry for now, as GeneratedShadowMap does need to be updated only on geometry changes.) So it's not applicable when only light conditions, materials, textures and such change. vcVisibleNonGeometry: Something visible changed, but not geometry. For example, material or texture on visible surface changed. vcCamera: Camera view (the settings passed to TCastleSceneCore.CameraChanged) changed.
`TVisibleChanges = set of TVisibleChange;`
`TVisibleChangeEvent = procedure (Sender: T3D; Changes: TVisibleChanges) of object;`
`TPrepareResourcesOption = (...);`
Various things that T3D.PrepareResources may prepare. ###### Values prRender: prBackground: prBoundingBox: prTrianglesListShadowCasters: prManifoldAndBorderEdges: prSpatial: Prepare octrees (determined by things like TCastleSceneCore.Spatial). prScreenEffects:
`TPrepareResourcesOptions = set of TPrepareResourcesOption;`
`PRayCollisionNode = ˆTRayCollisionNode;`
`TAbstractLightInstancesList = TFPSList;`
List of lights. Always TLightInstancesList, but we cannot declare it here as such.
`TRenderingPass = 0..1;`
`TRemoveType = (...);`
###### Values rtNone: rtRemove: rtRemoveAndFree:
`TOrientationType = (...);`
###### Values otUpYDirectionMinusZ: Sensible for worlds 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 T3DOrient.Orientation (or even T3DOrient.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: Sensible for worlds oriented around Z axis. Transformation makes -Y and +Z match (respectively) Direction and Up. Using this value for T3DOrient.Orientation (or even T3DOrient.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.
`T3DExistsEvent = function(const Item: T3D): boolean of object;`
### Constants
`MaxSingle = Math.MaxSingle;`
`DefaultFallMinHeightToDamage = 5.0;`
Default values common to TPlayer and TCreature classes. Note that FallMinHeightToSound is usually better to be larger for player, to avoid making "fall" sound when player merely jumps or walks down a steep hill. No such need for creature.
`DefaultFallDamageScaleMin = 0.8;`
`DefaultFallDamageScaleMax = 1.2;`
`DefaultCreatureFallMinHeightToSound = 1.0;`
`DefaultPlayerFallMinHeightToSound = 4.0;`
`DefaultCreatureFallSoundName = 'creature_fall';`
`DefaultPlayerFallSoundName = 'player_fall';`
`DirectionFromOrientation: array [TOrientationType] of TVector3Single = ( (0, 0, -1), (0, -1, 0), (1, 0, 0) );`
`UpFromOrientation: array [TOrientationType] of TVector3Single = ( (0, 1, 0), (0, 0, 1), (0, 0, 1) );`
### Variables
`RenderDebug3D: boolean = false;`
Creatures, items and possibly other 3D stuff may look at these variables to display additional features of 3D objects, helpful to debug collisions, AI and other things.
`RenderDebugCaptions: boolean = false;`
`LogShadowVolumes: boolean = false;`
Log shadow volume information. Meaningful only if you initialized log (see CastleLog unit) by InitializeLog first.
Generated by PasDoc 0.13.0 on 2015-06-15 04:43:07