Decals API
Part of Trace&Visibility API
Topics
Typedefs
hDecal | int[] |
Functions
proto native bool AddPointToLandMarkDecal(hDecal lmDecal, vector point, vector normal, float alpha) | add new point to decal, internally, new point is added when previous point is in some distance or the angle is more than some threshold | more… |
proto native int CanAddToLandMarkDecal(hDecal lmDecal, IEntity entity, string mat, vector newPoint) | is it possible to add new point to landmark decal? | more… |
proto native hDecal CreateDecal(IEntity entity, vector origin, vector project, float nearclip, float angle, float size, string materialName, float lifetime, int flags) | Creates single visual mark, e.g. from shots //when lifetime=0, pointer to decal is returned, that can be removed by RemoveDecal then | more… |
proto native hDecal CreateLandMarkDecal(IEntity entity, vector origin, vector normal, float edgeSize, float lifeTime, string materialName, hDecal prevDecal, float alpha) | Creates continous visual mark, e.g. from wheel when a car is moving on the ground | more… |
proto native void FinalizeLandMarkDecal(hDecal lmDecal, bool addAlpha, float alphaDist) | finalize landmark adding, e.g. when entity lose contact with ground -> the pointer to decal should have only world and entity if it has something to render, otherwise it's destroyed here | more… |
proto native vector GetLastLandMarkPoint(hDecal lmDecal) | return last landmark point or -65535.0 in all components | more… |
proto native bool IsLandMarkFinalized(hDecal lmDecal) | return if landmark was finalized | more… |
proto native void RemoveDecal(hDecal decal) | ||
proto native void SetGlobalLandMarkParams(float minSegmentLength, float maxSegmentLength, float degAngle) | set global parameters for landmark generation | more… |
Function Documentation
AddPointToLandMarkDecal
add new point to decal, internally, new point is added when previous point is in some distance or the angle is more than some threshold
lmDecal- entity to add new landmark point
point- contact point
normal- normal of contact
alpha- translucency in point
Returns: true if everything was OK, false if not. In this case, the application MUST not used later the pointer to decal, it's finalized internally !
CanAddToLandMarkDecal
is it possible to add new point to landmark decal?
lmDecal- entity to add new landmark point
entity- entity to add new landmark point
mat- material of decal
newpoint- new point to add
Returns: LMD_ERROR = error when adding new point (invalid decal) LMD_VALID = can add new point LMD_DIFF_ENT = new point is on different entity LMD_TOO_FAR = new point is too far from previous point
CreateDecal
proto native hDecal CreateDecal(IEntity entity, vector origin, vector project, float nearclip, float angle, float size, string materialName, float lifetime, int flags)Creates single visual mark, e.g. from shots //when lifetime=0, pointer to decal is returned, that can be removed by RemoveDecal then
entity- entity where the landmark should be created
origin- first point of the decal, nothing is done now
project- projection direction (length is far clipping distance)
nearclip- near clipping distance
materialName- Material used for decal
lifetime- Lifetime in seconds
flags- Not used ATM
Returns: Decal pointer or null
CreateLandMarkDecal
proto native hDecal CreateLandMarkDecal(IEntity entity, vector origin, vector normal, float edgeSize, float lifeTime, string materialName, hDecal prevDecal, float alpha)Creates continous visual mark, e.g. from wheel when a car is moving on the ground
entity- entity where the landmark should be created (only terrain is supported ATM)
origin- first point of the decal, nothing is done now
normal- normal of surface
edgesize- Edge size of decal
lifetime- Lifetime in seconds
materialName- Material used for decal
prev- Previous decal, we are connecting to
alpha- translucency of point
Returns: Decal pointer or null
FinalizeLandMarkDecal
finalize landmark adding, e.g. when entity lose contact with ground -> the pointer to decal should have only world and entity if it has something to render, otherwise it's destroyed here
lmDecal- entity to add new landmark point
addAlpha- if to add last point with transition to zero alpha
alphaDist- distance to add last point
GetLastLandMarkPoint
return last landmark point or -65535.0 in all components
lmDecal- decal to test
IsLandMarkFinalized
return if landmark was finalized
lmDecal- decal to test
SetGlobalLandMarkParams
proto native void SetGlobalLandMarkParams(float minSegmentLength, float maxSegmentLength, float degAngle)set global parameters for landmark generation
minSegmentLength- minimum length segment, when new point is added (4 default), when is less, just the end position is on the fly updated
maxSegmentLength- maximum segment length, when length is bigger, the path is finished
degAngle- angle in degrees, when is more, the path is finished