![]()
geSprite
Description: Implements a sprite system for Genesis3D
Note: This is only available in Genesis3D v1.6
Source file: ...\genesis3d\G3D\sprite.h
Functions: Create, CreateRef, Destroy, GetAlpha, GetBackface, GetBackfaceBitmap, GetBitmap, GetCount, GetExtBox, GetFaceCamera, GetInternalTransform, GetLightingOptions, GetNonWorldExtBox, GetPosition, GetScale, GetTextureParameters, GetTransform, GetUserData, IsValid, SetAlpha, SetBackface, SetExtBox, SetFaceCamera, SetInternalTransform, SetLightingOptions, SetPosition, SetScale, SetTextureParameters, SetTransform, SetUserData, RenderPrep, RenderThroughFrustum
Types: geSprite
Constants: view
Notes: view
Changes for Genesis3D v1.6: (This entire file is new)
![]()
Types:
NOTE: The contents of this structure have been intentionally left out of the interface, by the designers of this module. Think of this as a handle only.
![]()
Sprite flags (used for geWorld_AddSprite)
#define GE_SPRITE_RENDER_NORMAL (1<<0) // Render in normal views
#define GE_SPRITE_RENDER_MIRRORS (1<<1) // Render in mirror views
#define GE_SPRITE_RENDER_ALWAYS (1<<2) // Render always, skipping all visibility tests
#define GE_SPRITE_COLLIDE (1<<3) // Collide when calling geWorld_Collision
![]()
Functions::
![]()
GENESISAPI geSprite* GENESISCC geSprite_Create(geBitmap* SpriteBitmap, geBitmap* SpriteBackfaceBitmap);
Create a sprite instance associated with the given bitmaps as faces
Pass in a NULL bitmap for a gouraud face
Backface bitmap can be the same as the front face bitmap
![]()
GENESISAPI void GENESISCC geSprite_CreateRef(geSprite* Sprite);
Create an additional reference (owner) for the sprite
![]()
GENESISAPI void GENESISCC geSprite_Destroy(geSprite** pS);
Destroy a sprite
![]()
GENESISAPI int32 GENESISCC geSprite_GetCount();
Returns number of sprites that are currently created
![]()
GENESISAPI geBoolean GENESISCC geSprite_IsValid(const geSprite* S);
Checks to see if a sprite is valid or not
![]()
GENESISAPI geBitmap* GENESISCC geSprite_GetBitmap(const geSprite* S);
Returns the Bitmap associated with the sprite's front face
![]()
GENESISAPI geBitmap* GENESISCC geSprite_GetBackfaceBitmap(const geSprite* S);
Returns the Bitmap associated with the sprite's backface
![]()
GENESISAPI void GENESISCC geSprite_GetBackface(const geSprite* S, geBoolean* Enabled, geBoolean* MirrorImage);
Gets backface parameters
![]()
GENESISAPI void GENESISCC geSprite_SetBackface(geSprite* S, const geBoolean Enabled, const geBoolean MirrorImage);
Sets the backface parameters
![]()
GENESISAPI void GENESISCC geSprite_GetFaceCamera(const geSprite* S, geBoolean* Enabled);
Gets whether the sprite always faces the camera
![]()
GENESISAPI void GENESISCC geSprite_SetFaceCamera(geSprite* S, geBoolean Enabled);
Sets whether the sprite always faces the camera
![]()
GENESISAPI void GENESISCC geSprite_GetPosition(const geSprite* S, geVec3d* Pos);
Gets the position of the sprite
![]()
GENESISAPI void GENESISCC geSprite_SetPosition(geSprite* S, const geVec3d* Pos);
Sets the position of the sprite
For easy modification of the sprite position if the sprite always faces the camera
![]()
GENESISAPI void GENESISCC geSprite_GetTransform(const geSprite* S, geXForm3d* Transform);
Gets the current transform for the sprite
![]()
GENESISAPI void GENESISCC geSprite_SetTransform(geSprite* S, const geXForm3d* Transform);
Sets the current transform for the sprite
Rotation information is ignored if the sprite always faces the camera
![]()
GENESISAPI void GENESISCC geSprite_GetInternalTransform(const geSprite* S, geXForm3d* Transform);
Gets the internal transform for the sprite
![]()
GENESISAPI void GENESISCC geSprite_SetInternalTransform(geSprite* S, const geXForm3d* Transform);
Sets the internal transform for the sprite
Allows the sprite to be rendered offset from its main transform. For example, translation could make the bottom of the sprite its center of rotation.
This is totally ignored if the sprite always faces the camera
![]()
GENESISAPI void GENESISCC geSprite_GetScale(const geSprite* S, geFloat* ScaleX, geFloat* ScaleY);
Gets the scale of the sprite (width and height)
![]()
GENESISAPI void GENESISCC geSprite_SetScale(geSprite* S, geFloat ScaleX, geFloat ScaleY);
Sets the scale of the sprite (width and height)
![]()
GENESISAPI void GENESISCC geSprite_GetExtBox(const geSprite* S, geExtBox* ExtBox);
Gets an assigned general non changing bounding box from the sprite
![]()
GENESISAPI void GENESISCC geSprite_GetNonWorldExtBox(const geSprite* S, geExtBox* ExtBox);
Gets the bounding box in non-world coordinates
Whatever you put in with geSprite_SetExtBox, you get out with this function
![]()
GENESISAPI void GENESISCC geSprite_SetExtBox(geSprite* S, const geExtBox* ExtBox);
Sets an assigned general non changing bounding box from the sprite
![]()
GENESISAPI void GENESISCC geSprite_GetTextureParameters(const geSprite* S, geFloat* OffsetX, geFloat* OffsetY, geFloat* ScaleX, geFloat* ScaleY);
Gets the texture parameters for the sprite
![]()
GENESISAPI void GENESISCC geSprite_SetTextureParameters(geSprite* S, geFloat OffsetX, geFloat OffsetY, geFloat ScaleX, geFloat ScaleY);
Sets the texture parameters for the sprite
![]()
GENESISAPI void GENESISCC geSprite_GetLightingOptions(const geSprite* S, geFloat* AmbientLightRed, geFloat* AmbientLightGreen, geFloat* AmbientLightBlue, geBoolean* UseFillLight, geVec3d* FillLightNormal, geFloat* FillLightRed, geFloat* FillLightGreen, geFloat* FillLightBlue, geBoolean* UseLightFromFloor, int32* MaximumDynamicLightsToUse);
Note:
All geFloat
values will be 0..255.
FillLightNormal is a normalized vector
MaximumDynamicLightsToUse = 0 if None
![]()
GENESISAPI void GENESISCC geSprite_SetLightingOptions(const geSprite* S, geFloat* AmbientLightRed, geFloat* AmbientLightGreen, geFloat* AmbientLightBlue, geBoolean* UseFillLight, geVec3d* FillLightNormal, geFloat* FillLightRed, geFloat* FillLightGreen, geFloat* FillLightBlue, geBoolean* UseLightFromFloor, int32* MaximumDynamicLightsToUse);
Note:
All geFloat
values should be 0..255.
FillLightNormal is a normalized vector
MaximumDynamicLightsToUse = 0 if None
![]()
GENESISAPI void GENESISCC geSprite_GetAlpha(const geSprite* S, geFloat* Alpha, geFloat* BackfaceAlpha);
Gets the alpha transparency of the sprite
![]()
GENESISAPI void GENESISCC geSprite_SetAlpha(geSprite* S, geFloat Alpha, geFloat BackfaceAlpha);
Sets the alpha transparency of the sprite
![]()
GENESISAPI void * GENESISCC geSprite_GetUserData(const geSprite* S);
Returns the pointer which was set with geSprite_SetUserData. NULL if not set.
![]()
GENESISAPI void GENESISCC geSprite_SetUserData(geSprite* S, void * UserData);
Sets the sprites user data pointer to the given value. For clients only.
![]()
geBoolean GENESISCC geSprite_RenderPrep(geSprite* A, geWorld* World);
This is a GENESIS_PRIVATE_APIS
Only available if: #ifdef GE_WORLD_H
Prepares the geSprite for rendering and posing. Call Once once the sprite is fully created.
Must be called prior to render/pose/setworldtransform
![]()
geBoolean GENESISCC geSprite_RenderThroughFrustum(geSprite* S, geEngine* Engine, geWorld* World, geCamera* Camera, Frustum_Info* FInfo);
This is a GENESIS_PRIVATE_APIS
Only available if: #ifdef GE_WORLD_H
Draws the geSprite. (RenderPrep must be called first)
![]()
In general: Objects retuned from Get functions should not not be destroyed. If ownership is desired, call the objects _CreateRef() function to create another owner. (An 'owner' has access to the object regardless of the number of other owners, and an owner must call the object's _Destroy() function to relinquish ownership )
![]()