Etterna 0.74.4
Loading...
Searching...
No Matches
Classes | Public Types | Public Member Functions | Static Public Member Functions | Public Attributes | Protected Member Functions | Protected Attributes | Static Protected Attributes | List of all members
Actor Class Reference

Base class for all objects that appear on the screen. More...

#include <Actor.h>

Inheritance diagram for Actor:
Inheritance graph
[legend]
Collaboration diagram for Actor:
Collaboration graph
[legend]

Classes

struct  TweenInfo
 Some general information about the Tween. More...
 
struct  TweenState
 The present state for the Tween. More...
 
struct  TweenStateAndInfo
 

Public Types

enum  Effect {
  no_effect , diffuse_blink , diffuse_shift , diffuse_ramp ,
  glow_blink , glow_shift , glow_ramp , rainbow ,
  wag , bounce , bob , pulse ,
  spin , vibrate
}
 The list of the different effects. More...
 
enum  EffectClock {
  CLOCK_TIMER , CLOCK_TIMER_GLOBAL , CLOCK_BGM_TIME , CLOCK_BGM_BEAT ,
  CLOCK_BGM_TIME_NO_OFFSET , CLOCK_BGM_BEAT_NO_OFFSET , CLOCK_BGM_BEAT_PLAYER1 , CLOCK_BGM_BEAT_PLAYER2 ,
  CLOCK_LIGHT_1 = 1000 , CLOCK_LIGHT_LAST = 1100 , NUM_CLOCKS
}
 Various values an Actor's effect can be tied to.
 
enum  StretchType { fit_inside , cover }
 How do we handle stretching the Actor? More...
 

Public Member Functions

 Actor ()
 Set up the Actor with its initial settings.
 
 Actor (const Actor &cpy)
 Copy a new Actor to the old one.
 
Actoroperator= (const Actor &x)
 
virtual auto Copy () const -> Actor *
 
virtual void InitState ()
 
virtual void LoadFromNode (const XNode *pNode)
 
auto PartiallyOpaque () const -> bool
 
auto IsOver (float mx, float my) -> bool
 
auto GetFakeParentOrParent () -> Actor *
 
auto GetTrueX () -> float
 
auto GetTrueY () -> float
 
auto GetTrueZ () -> float
 
auto GetTrueRotationX () -> float
 
auto GetTrueRotationY () -> float
 
auto GetTrueRotationZ () -> float
 
auto GetTrueZoom () -> float
 
auto GetTrueZoomX () -> float
 
auto GetTrueZoomY () -> float
 
auto GetTrueZoomZ () -> float
 
auto IsVisible () -> bool
 
void Draw ()
 Calls multiple functions for drawing the Actors.
 
virtual auto EarlyAbortDraw () const -> bool
 Allow the Actor to be aborted early.
 
virtual void PreDraw ()
 Calculate values that may be needed for drawing.
 
virtual void PostDraw ()
 Reset internal diffuse and glow.
 
virtual void BeginDraw ()
 Start the drawing and push the transform on the world matrix stack.
 
virtual void SetGlobalRenderStates ()
 Set the global rendering states of this Actor.
 
virtual void SetTextureRenderStates ()
 Set the texture rendering states of this Actor.
 
virtual void DrawPrimitives ()
 Draw the primitives of the Actor.
 
virtual void EndDraw ()
 Pop the transform from the world matrix stack.
 
virtual void Update (float fDeltaTime)
 
virtual void UpdateInternal (float fDeltaTime)
 
void UpdateTweening (float fDeltaTime)
 
void CalcPercentThroughTween ()
 
virtual void SetCurrentTweenStart ()
 
virtual void EraseHeadTween ()
 
virtual void UpdatePercentThroughTween (float PercentThroughTween)
 
auto get_tween_uses_effect_delta () const -> bool
 
void set_tween_uses_effect_delta (bool t)
 
auto GetName () const -> const std::string &
 Retrieve the Actor's name.
 
virtual void SetName (const std::string &sName)
 Set the Actor's name to a new one.
 
void SetParent (Actor *pParent)
 Give this Actor a new parent.
 
auto GetParent () const -> Actor *
 Retrieve the Actor's parent.
 
auto GetLineage () const -> std::string
 Retrieve the Actor's lineage.
 
void SetFakeParent (Actor *mailman)
 
auto GetFakeParent () const -> Actor *
 
void AddWrapperState ()
 
void RemoveWrapperState (size_t i)
 
auto GetWrapperState (size_t i) -> Actor *
 
auto GetNumWrapperStates () const -> size_t
 
auto GetX () const -> float
 Retrieve the Actor's x position.
 
auto GetY () const -> float
 Retrieve the Actor's y position.
 
auto GetZ () const -> float
 Retrieve the Actor's z position.
 
auto GetDestX () const -> float
 
auto GetDestY () const -> float
 
auto GetDestZ () const -> float
 
void SetX (float x)
 
void SetY (float y)
 
void SetZ (float z)
 
void SetXY (float x, float y)
 
void AddX (float x)
 Add to the x position of this Actor.
 
void AddY (float y)
 Add to the y position of this Actor.
 
void AddZ (float z)
 Add to the z position of this Actor.
 
auto GetUnzoomedWidth () const -> float
 
auto GetUnzoomedHeight () const -> float
 
auto GetZoomedWidth () const -> float
 
auto GetZoomedHeight () const -> float
 
void SetWidth (float width)
 
void SetHeight (float height)
 
auto GetBaseZoomX () const -> float
 
void SetBaseZoomX (float zoom)
 
auto GetBaseZoomY () const -> float
 
void SetBaseZoomY (float zoom)
 
auto GetBaseZoomZ () const -> float
 
void SetBaseZoomZ (float zoom)
 
void SetBaseZoom (float zoom)
 
void SetBaseRotationX (float rot)
 
void SetBaseRotationY (float rot)
 
void SetBaseRotationZ (float rot)
 
void SetBaseRotation (const RageVector3 &rot)
 
virtual void SetBaseAlpha (float fAlpha)
 
void SetInternalDiffuse (const RageColor &c)
 
void SetInternalGlow (const RageColor &c)
 
auto GetZoom () const -> float
 Retrieve the general zoom factor, using the x coordinate of the Actor.
 
auto GetZoomX () const -> float
 Retrieve the zoom factor for the x coordinate of the Actor.
 
auto GetZoomY () const -> float
 Retrieve the zoom factor for the y coordinate of the Actor.
 
auto GetZoomZ () const -> float
 Retrieve the zoom factor for the z coordinate of the Actor.
 
void SetZoom (float zoom)
 Set the zoom factor for all dimensions of the Actor.
 
void SetZoomX (float zoom)
 Set the zoom factor for the x dimension of the Actor.
 
void SetZoomY (float zoom)
 Set the zoom factor for the y dimension of the Actor.
 
void SetZoomZ (float zoom)
 Set the zoom factor for the z dimension of the Actor.
 
void ZoomTo (float fX, float fY)
 
void ZoomToWidth (float zoom)
 
void ZoomToHeight (float zoom)
 
auto GetRotationX () const -> float
 
auto GetRotationY () const -> float
 
auto GetRotationZ () const -> float
 
void SetRotationX (float rot)
 
void SetRotationY (float rot)
 
void SetRotationZ (float rot)
 
void AddRotationX (float rot)
 
void AddRotationY (float rot)
 
void AddRotationZ (float rot)
 
void AddRotationH (float rot)
 
void AddRotationP (float rot)
 
void AddRotationR (float rot)
 
void SetSkewX (float fAmount)
 
auto GetSkewX (float) const -> float
 
void SetSkewY (float fAmount)
 
auto GetSkewY (float) const -> float
 
auto GetCropLeft () const -> float
 
auto GetCropTop () const -> float
 
auto GetCropRight () const -> float
 
auto GetCropBottom () const -> float
 
void SetCropLeft (float percent)
 
void SetCropTop (float percent)
 
void SetCropRight (float percent)
 
void SetCropBottom (float percent)
 
void SetFadeLeft (float percent)
 
void SetFadeTop (float percent)
 
void SetFadeRight (float percent)
 
void SetFadeBottom (float percent)
 
void SetGlobalDiffuseColor (const RageColor &c)
 
virtual void SetDiffuse (const RageColor &c)
 
virtual void SetDiffuseAlpha (float f)
 
auto GetCurrentDiffuseAlpha () const -> float
 
void SetDiffuseColor (const RageColor &c)
 
void SetDiffuses (int i, const RageColor &c)
 
void SetDiffuseUpperLeft (const RageColor &c)
 
void SetDiffuseUpperRight (const RageColor &c)
 
void SetDiffuseLowerLeft (const RageColor &c)
 
void SetDiffuseLowerRight (const RageColor &c)
 
void SetDiffuseTopEdge (const RageColor &c)
 
void SetDiffuseRightEdge (const RageColor &c)
 
void SetDiffuseBottomEdge (const RageColor &c)
 
void SetDiffuseLeftEdge (const RageColor &c)
 
auto GetDiffuse () const -> RageColor
 
auto GetDiffuses (int i) const -> RageColor
 
auto GetDiffuseAlpha () const -> float
 
void SetGlow (const RageColor &c)
 
auto GetGlow () const -> RageColor
 
void SetAux (float f)
 
auto GetAux () const -> float
 
virtual void BeginTweening (float time, ITween *pInterp)
 
virtual void BeginTweening (float time, TweenType tt=TWEEN_LINEAR)
 
virtual void StopTweening ()
 
void Sleep (float time)
 
void QueueCommand (const std::string &sCommandName)
 
void QueueMessage (const std::string &sMessageName)
 
virtual void FinishTweening ()
 
virtual void HurryTweening (float factor)
 
virtual auto GetTweenTimeLeft () const -> float
 
auto DestTweenState () -> TweenState &
 
auto DestTweenState () const -> const TweenState &
 
void ScaleToCover (const RectF &rect)
 
void ScaleToFitInside (const RectF &rect)
 
void ScaleTo (const RectF &rect, StretchType st)
 
void StretchTo (const RectF &rect)
 
virtual void SetHorizAlign (float f)
 
virtual void SetVertAlign (float f)
 
void SetHorizAlign (HorizAlign ha)
 
void SetVertAlign (VertAlign va)
 
virtual auto GetHorizAlign () -> float
 
virtual auto GetVertAlign () -> float
 
void StopEffect ()
 
auto GetEffect () const -> Effect
 
auto GetSecsIntoEffect () const -> float
 
auto GetEffectDelta () const -> float
 
void SetEffectColor1 (const RageColor &c)
 
void SetEffectColor2 (const RageColor &c)
 
void RecalcEffectPeriod ()
 
void SetEffectPeriod (float fTime)
 
auto GetEffectPeriod () const -> float
 
auto SetEffectTiming (float ramp_toh, float at_half, float ramp_tof, float at_zero, float at_full, std::string &err) -> bool
 
auto SetEffectHoldAtFull (float haf, std::string &err) -> bool
 
void SetEffectOffset (float fTime)
 
void SetEffectClock (EffectClock c)
 
void SetEffectClockString (const std::string &s)
 
void SetEffectMagnitude (const RageVector3 &vec)
 
auto GetEffectMagnitude () const -> RageVector3
 
void ResetEffectTimeIfDifferent (Effect new_effect)
 
void SetEffectDiffuseBlink (float fEffectPeriodSeconds, const RageColor &c1, const RageColor &c2)
 
void SetEffectDiffuseShift (float fEffectPeriodSeconds, const RageColor &c1, const RageColor &c2)
 
void SetEffectDiffuseRamp (float fEffectPeriodSeconds, const RageColor &c1, const RageColor &c2)
 
void SetEffectGlowBlink (float fEffectPeriodSeconds, const RageColor &c1, const RageColor &c2)
 
void SetEffectGlowShift (float fEffectPeriodSeconds, const RageColor &c1, const RageColor &c2)
 
void SetEffectGlowRamp (float fEffectPeriodSeconds, const RageColor &c1, const RageColor &c2)
 
void SetEffectRainbow (float fEffectPeriodSeconds)
 
void SetEffectWag (float fPeriod, const RageVector3 &vect)
 
void SetEffectBounce (float fPeriod, const RageVector3 &vect)
 
void SetEffectBob (float fPeriod, const RageVector3 &vect)
 
void SetEffectPulse (float fPeriod, float fMinZoom, float fMaxZoom)
 
void SetEffectSpin (const RageVector3 &vect)
 
void SetEffectVibrate (const RageVector3 &vect)
 
auto GetVisible () const -> bool
 Determine if the Actor is visible at this time.
 
void SetVisible (bool b)
 
void SetShadowLength (float fLength)
 
void SetShadowLengthX (float fLengthX)
 
void SetShadowLengthY (float fLengthY)
 
void SetShadowColor (const RageColor &c)
 
void SetDrawOrder (int iOrder)
 
auto GetDrawOrder () const -> int
 
virtual void EnableAnimation (bool b)
 
void StartAnimating ()
 
void StopAnimating ()
 
void SetBlendMode (BlendMode mode)
 
void SetTextureTranslate (float x, float y)
 
void SetTextureWrapping (bool b)
 
void SetTextureFiltering (bool b)
 
void SetClearZBuffer (bool b)
 
void SetUseZBuffer (bool b)
 
virtual void SetZTestMode (ZTestMode mode)
 
virtual void SetZWrite (bool b)
 
void SetZBias (float f)
 
virtual void SetCullMode (CullMode mode)
 
virtual void PushSelf (lua_State *L)
 
virtual void PushContext (lua_State *L)
 
void AddCommand (const std::string &sCmdName, const apActorCommands &apac, bool warn=true)
 
auto HasCommand (const std::string &sCmdName) const -> bool
 
auto GetCommand (const std::string &sCommandName) const -> const apActorCommands *
 
void PlayCommand (const std::string &sCommandName)
 
void PlayCommandNoRecurse (const Message &msg)
 
virtual void RunCommands (const LuaReference &cmds, const LuaReference *pParamTable=nullptr)
 
virtual void RunCommands (const apActorCommands &cmds, const LuaReference *pParamTable=nullptr)
 
virtual void RunCommandsRecursively (const LuaReference &cmds, const LuaReference *pParamTable=nullptr)
 
virtual void RunCommandsOnLeaves (const LuaReference &cmds, const LuaReference *pParamTable=nullptr)
 
void HandleMessage (const Message &msg) override
 
virtual auto GetNumStates () const -> int
 
virtual void SetState (int)
 
virtual auto GetAnimationLengthSeconds () const -> float
 
virtual void SetSecondsIntoAnimation (float)
 
virtual void SetUpdateRate (float)
 
virtual auto GetUpdateRate () -> float
 
- Public Member Functions inherited from MessageSubscriber
 MessageSubscriber (const MessageSubscriber &cpy)
 
auto operator= (const MessageSubscriber &cpy) -> MessageSubscriber &
 
void SubscribeToMessage (MessageID message)
 
void SubscribeToMessage (const std::string &sMessageName)
 
void UnsubscribeAll ()
 
- Public Member Functions inherited from IMessageSubscriber
void ClearMessages (const std::string &sMessage="")
 

Static Public Member Functions

static void SetBGMTime (float fTime, float fBeat, float fTimeNoOffset, float fBeatNoOffset)
 
static void SetPlayerBGMBeat (float fBeat, float fBeatNoOffset)
 

Public Attributes

std::unique_ptr< LuaClassm_pLuaInstance
 

Protected Member Functions

auto GetEffectDeltaTime () const -> float
 

Protected Attributes

std::string m_sName
 the name of the Actor.
 
Actorm_pParent
 the current parent of this Actor if it exists.
 
Actorm_FakeParent
 
std::vector< Actor * > m_WrapperStates
 
RageVector3 m_baseRotation
 
RageVector3 m_baseScale
 
float m_fBaseAlpha {}
 
RageColor m_internalDiffuse
 
RageColor m_internalGlow
 
RageVector2 m_size
 
TweenState m_current
 
TweenState m_start
 
std::vector< TweenStateAndInfo * > m_Tweens
 
TweenStatem_pTempState {}
 Temporary variables that are filled just before drawing.
 
float m_fHorizAlign {}
 The particular horizontal alignment.
 
float m_fVertAlign {}
 The particular vertical alignment.
 
Effect m_Effect
 
float m_fSecsIntoEffect {}
 
float m_fEffectDelta {}
 
float m_effect_ramp_to_half {}
 
float m_effect_hold_at_half {}
 
float m_effect_ramp_to_full {}
 
float m_effect_hold_at_full {}
 
float m_effect_hold_at_zero {}
 
float m_fEffectOffset {}
 
float m_effect_period {}
 
EffectClock m_EffectClock
 
bool m_tween_uses_effect_delta
 
RageColor m_effectColor1
 
RageColor m_effectColor2
 
RageVector3 m_vEffectMagnitude
 
bool m_bVisible {}
 
bool m_bIsAnimating {}
 
float m_fShadowLengthX {}
 
float m_fShadowLengthY {}
 
RageColor m_ShadowColor
 
int m_iDrawOrder {}
 The draw order priority.
 
BlendMode m_BlendMode
 
ZTestMode m_ZTestMode
 
CullMode m_CullMode
 
RageVector2 m_texTranslate
 
bool m_bTextureWrapping {}
 
bool m_bTextureFiltering {}
 
bool m_bClearZBuffer {}
 
bool m_bZWrite {}
 
float m_fZBias {}
 The amount of bias.
 

Static Protected Attributes

static float g_fCurrentBGMTime = 0
 
static float g_fCurrentBGMBeat
 
static float g_fCurrentBGMTimeNoOffset = 0
 
static float g_fCurrentBGMBeatNoOffset = 0
 
static std::vector< float > g_vfCurrentBGMBeatPlayer
 
static std::vector< float > g_vfCurrentBGMBeatPlayerNoOffset
 

Detailed Description

Base class for all objects that appear on the screen.

Member Enumeration Documentation

◆ Effect

The list of the different effects.

todo: split out into diffuse effects and translation effects, or create an effect stack instead. -aj

◆ StretchType

How do we handle stretching the Actor?

Enumerator
fit_inside 

Have the Actor fit inside its parent, using the smaller zoom.

cover 

Have the Actor cover its parent, using the larger zoom.

Constructor & Destructor Documentation

◆ Actor()

Actor::Actor ( const Actor cpy)

Copy a new Actor to the old one.

Parameters
cpythe new Actor to use in place of this one.

Member Function Documentation

◆ AddX()

void Actor::AddX ( float  x)
inline

Add to the x position of this Actor.

Parameters
xthe amount to add to the Actor's x position.

◆ AddY()

void Actor::AddY ( float  y)
inline

Add to the y position of this Actor.

Parameters
ythe amount to add to the Actor's y position.

◆ AddZ()

void Actor::AddZ ( float  z)
inline

Add to the z position of this Actor.

Parameters
zthe amount to add to the Actor's z position.

◆ BeginDraw()

void Actor::BeginDraw ( )
virtual

Start the drawing and push the transform on the world matrix stack.

Reimplemented in ActorFrame.

◆ Copy()

Actor * Actor::Copy ( ) const -> Actor*
virtual

Reimplemented in Quad, SongBPMDisplay, and BPMDisplay.

◆ Draw()

void Actor::Draw ( )

Calls multiple functions for drawing the Actors.

It calls the following in order:

  1. EarlyAbortDraw
  2. BeginDraw
  3. DrawPrimitives
  4. EndDraw

◆ DrawPrimitives()

virtual void Actor::DrawPrimitives ( )
inlinevirtual

◆ EarlyAbortDraw()

virtual auto Actor::EarlyAbortDraw ( ) const -> bool
inlinevirtual

Allow the Actor to be aborted early.

Subclasses may wish to overwrite this to allow for aborted actors.

Returns
false, as by default Actors shouldn't be aborted on drawing.

Reimplemented in ActorProxy, BitmapText, Sprite, ActorMultiVertex, Model, Background, and Transition.

◆ EndDraw()

void Actor::EndDraw ( )
virtual

Pop the transform from the world matrix stack.

Reimplemented in ActorFrame.

◆ GetLineage()

std::string Actor::GetLineage ( ) const -> std::string

Retrieve the Actor's lineage.

Returns
the Actor's lineage.

◆ GetName()

auto Actor::GetName ( ) const -> const std::string&
inline

Retrieve the Actor's name.

Returns
the Actor's name.

◆ GetParent()

auto Actor::GetParent ( ) const -> Actor*
inline

Retrieve the Actor's parent.

Returns
the Actor's parent.

◆ GetTweenTimeLeft()

float Actor::GetTweenTimeLeft ( ) const -> float
virtual

Reimplemented in ActorFrame, and Transition.

◆ GetVisible()

auto Actor::GetVisible ( ) const -> bool
inline

Determine if the Actor is visible at this time.

Returns
true if it's visible, false otherwise.

◆ GetX()

auto Actor::GetX ( ) const -> float
inline

Retrieve the Actor's x position.

Returns
the Actor's x position.

◆ GetY()

auto Actor::GetY ( ) const -> float
inline

Retrieve the Actor's y position.

Returns
the Actor's y position.

◆ GetZ()

auto Actor::GetZ ( ) const -> float
inline

Retrieve the Actor's z position.

Returns
the Actor's z position.

◆ GetZoom()

auto Actor::GetZoom ( ) const -> float
inline

Retrieve the general zoom factor, using the x coordinate of the Actor.

Note that this is not accurate in some cases.

Returns
the zoom factor for the x coordinate of the Actor.

◆ GetZoomX()

auto Actor::GetZoomX ( ) const -> float
inline

Retrieve the zoom factor for the x coordinate of the Actor.

Returns
the zoom factor for the x coordinate of the Actor.

◆ GetZoomY()

auto Actor::GetZoomY ( ) const -> float
inline

Retrieve the zoom factor for the y coordinate of the Actor.

Returns
the zoom factor for the y coordinate of the Actor.

◆ GetZoomZ()

auto Actor::GetZoomZ ( ) const -> float
inline

Retrieve the zoom factor for the z coordinate of the Actor.

Returns
the zoom factor for the z coordinate of the Actor.

◆ HandleMessage()

void Actor::HandleMessage ( const Message msg)
overridevirtual

Implements IMessageSubscriber.

◆ InitState()

void Actor::InitState ( )
virtual

Reimplemented in ActorFrame.

◆ LoadFromNode()

void Actor::LoadFromNode ( const XNode pNode)
virtual

Reimplemented in Quad.

◆ SetGlobalRenderStates()

void Actor::SetGlobalRenderStates ( )
virtual

Set the global rendering states of this Actor.

This should be called at the beginning of an Actor's DrawPrimitives() call.

◆ SetName()

virtual void Actor::SetName ( const std::string &  sName)
inlinevirtual

Set the Actor's name to a new one.

Parameters
sNamethe new name for the Actor.

◆ SetParent()

void Actor::SetParent ( Actor pParent)

Give this Actor a new parent.

Parameters
pParentthe new parent Actor.

◆ SetTextureRenderStates()

void Actor::SetTextureRenderStates ( )
virtual

Set the texture rendering states of this Actor.

This should be called after setting a texture for the Actor.

◆ SetZoom()

void Actor::SetZoom ( float  zoom)
inline

Set the zoom factor for all dimensions of the Actor.

Parameters
zoomthe zoom factor for all dimensions.

◆ SetZoomX()

void Actor::SetZoomX ( float  zoom)
inline

Set the zoom factor for the x dimension of the Actor.

Parameters
zoomthe zoom factor for the x dimension.

◆ SetZoomY()

void Actor::SetZoomY ( float  zoom)
inline

Set the zoom factor for the y dimension of the Actor.

Parameters
zoomthe zoom factor for the y dimension.

◆ SetZoomZ()

void Actor::SetZoomZ ( float  zoom)
inline

Set the zoom factor for the z dimension of the Actor.

Parameters
zoomthe zoom factor for the z dimension.

◆ Update()

void Actor::Update ( float  fDeltaTime)
virtual

Reimplemented in SongBPMDisplay, and BPMDisplay.

Member Data Documentation

◆ m_fHorizAlign

float Actor::m_fHorizAlign {}
protected

The particular horizontal alignment.

Use the defined constant values for best effect.

◆ m_fVertAlign

float Actor::m_fVertAlign {}
protected

The particular vertical alignment.

Use the defined constant values for best effect.

◆ m_fZBias

float Actor::m_fZBias {}
protected

The amount of bias.

If 0, there is no bias. If 1, there is a full bias.

◆ m_iDrawOrder

int Actor::m_iDrawOrder {}
protected

The draw order priority.

The lower this number is, the sooner it is drawn.


The documentation for this class was generated from the following files: