Isle
Loading...
Searching...
No Matches
LegoActor Class Reference

[AI] Represents an actor (character) entity in the LEGO Island 3D world, providing specific actor logic, such as sound, camera, and identity. More...

#include <legoactor.h>

Inheritance diagram for LegoActor:
Collaboration diagram for LegoActor:

Public Types

enum  {
  c_none = 0 , c_pepper , c_mama , c_papa ,
  c_nick , c_laura , c_brickster
}
 [AI] Enumeration of actor IDs for known characters. More...
 
- Public Types inherited from LegoEntity
enum  Type {
  e_actor = 0 , e_unk1 , e_plant , e_building ,
  e_autoROI
}
 [AI] Types of LegoEntity (Actor, Plant, Building, Auto ROI, etc.) [AI] More...
 
enum  { c_bit1 = 0x01 , c_managerOwned = 0x02 }
 [AI] Bit flag constants for entity state management [AI] More...
 
enum  { c_altBit1 = 0x01 }
 [AI] Secondary bit flag constants [AI] More...
 

Public Member Functions

 LegoActor ()
 [AI] Constructs new LegoActor, initializes members. More...
 
 ~LegoActor () override
 [AI] Cleans up LegoActor; stops sound if active. More...
 
const char * ClassName () const override
 [AI] Gets the class name of this object. More...
 
MxBool IsA (const char *p_name) const override
 [AI] Determines if the class is or derives from the given name. More...
 
void ParseAction (char *p_extra) override
 [AI] Parses an action string and applies parsed behaviors to the actor. More...
 
void SetROI (LegoROI *p_roi, MxBool p_bool1, MxBool p_bool2) override
 [AI] Sets the Region of Interest (ROI, i.e. More...
 
virtual MxFloat GetSoundFrequencyFactor ()
 [AI] Returns the current frequency factor for the actor's sound. More...
 
virtual void SetSoundFrequencyFactor (MxFloat p_frequencyFactor)
 [AI] Sets the frequency factor for the actor's sound playback (e.g., to alter pitch). More...
 
virtual void VTable0x58 (MxFloat p_unk0x70)
 [AI] Sets a floating point property, unknown usage (possibly animation or audio parameter). More...
 
virtual MxFloat VTable0x5c ()
 [AI] Gets the unknown floating point property set by VTable0x58. [AI] [AI_SUGGESTED_NAME: GetVoicePitchModifier] More...
 
virtual MxU8 GetActorId ()
 [AI] Gets this actor's numeric ID, corresponding to a known enumeration/actor. More...
 
virtual void SetActorId (MxU8 p_actorId)
 [AI] Sets the actor's numeric ID. More...
 
void Mute (MxBool p_muted)
 [AI] Mutes or unmutes the actor's current sound. More...
 
- Public Member Functions inherited from LegoEntity
 LegoEntity ()
 [AI] Default constructor. Initializes the LegoEntity with default values. [AI] More...
 
 ~LegoEntity () override
 [AI] Destructor. Cleans up resources and ensures ROI and script state are released. [AI] More...
 
MxLong Notify (MxParam &p_param) override
 [AI] Handles event notification for the entity, most notably user clicks, using polymorphic dispatch. More...
 
const char * ClassName () const override
 [AI] Returns the class name string. Used in entity runtime type identification. [AI] More...
 
MxBool IsA (const char *p_name) const override
 [AI] Polymorphic type check for this entity given a string. More...
 
virtual MxResult Create (MxDSAction &p_dsAction)
 [AI] Initializes the entity from a DSAction object, typically from a script or file load. More...
 
virtual void Destroy (MxBool p_fromDestructor)
 [AI] Cleans up the entity, detaching ROI and releasing references. More...
 
virtual void ParseAction (char *p_extra)
 [AI] Parses an action description string (usually from script "extra" data) and sets up this entity's action state. More...
 
virtual void SetROI (LegoROI *p_roi, MxBool p_bool1, MxBool p_bool2)
 [AI] Assigns a 3D ROI (3D object instance) to this entity, controlling how it appears/acts in the world. More...
 
virtual void SetWorldTransform (const Vector3 &p_location, const Vector3 &p_direction, const Vector3 &p_up)
 [AI] Explicitly sets the world transformation (location, direction, up vector) for this entity. More...
 
virtual void ResetWorldTransform (MxBool p_cameraFlag)
 [AI] Resets the transformation for this entity (e.g., used with camera transitions). More...
 
virtual void SetWorldSpeed (MxFloat p_worldSpeed)
 [AI] Sets the current world speed value for this entity (used to control motion/animation rate). More...
 
virtual void ClickSound (MxBool p_und)
 [AI] Plays a click sound, typically in response to user/AI actions, according to entity type. More...
 
virtual void ClickAnimation ()
 [AI] Plays a context-sensitive click animation, driven by current entity type and state. [AI] More...
 
virtual void SwitchVariant ()
 [AI] Switches variants for this entity (e.g., different animation, mesh, or texture variant), based on type. [AI] More...
 
virtual void SwitchSound ()
 [AI] Triggers a context-dependent audio/sound variant switch for this entity. [AI] More...
 
virtual void SwitchMove ()
 [AI] Switches movement/animation variant for this entity, if applicable (e.g., walking/running state). [AI] More...
 
virtual void SwitchColor (LegoROI *p_roi)
 [AI] Switches the color or texture variant for this entity (or target ROI). More...
 
virtual void SwitchMood ()
 [AI] Triggers a mood/state switch for this entity (if supported), often for characters. [AI] More...
 
void FUN_10010c30 ()
 [AI] Updates the camera transformation when this entity is the camera target. Used after movement or position updates. [AI] More...
 
void SetType (MxU8 p_type)
 [AI] Sets the entity's type (actor/plant/building/etc.) [AI] More...
 
void SetLocation (const Vector3 &p_location, const Vector3 &p_direction, const Vector3 &p_up, MxBool p_und)
 [AI] Sets the world-space location, direction, and up, applying normalization and transformation. More...
 
Mx3DPointFloat GetWorldDirection ()
 [AI] Gets the normalized world-space direction vector, optionally updating from ROI. [AI] More...
 
Mx3DPointFloat GetWorldUp ()
 [AI] Gets the normalized world-space up vector, optionally updating from ROI. [AI] More...
 
Mx3DPointFloat GetWorldPosition ()
 [AI] Gets the world-space position vector, optionally updating from ROI. [AI] More...
 
MxBool GetUnknown0x10IsSet (MxU8 p_flag)
 [AI] Checks if a bit flag in m_unk0x10 is set (purpose: state/animation suppression lock). More...
 
MxBool GetFlagsIsSet (MxU8 p_flag)
 [AI] Checks if a flag is set in the primary flags byte (m_flags). More...
 
MxU8 GetFlags ()
 [AI] Returns the value of the flag byte. [AI] More...
 
MxFloat GetWorldSpeed ()
 [AI] Gets the entity's current world speed state. [AI] More...
 
LegoROIGetROI ()
 [AI] Gets the ROI (Realtime Object Instance) associated with this entity. [AI] More...
 
MxU8 GetType ()
 [AI] Gets the type of this entity (one of the enum Type values). [AI] More...
 
MxBool GetCameraFlag ()
 [AI] Returns whether this entity is flagged as camera (affects world/camera synchronization). [AI] More...
 
void SetFlags (MxU8 p_flags)
 [AI] Sets all entity flags at once (replaces previous). More...
 
void SetFlag (MxU8 p_flag)
 [AI] Sets the given flag in the flags byte. More...
 
void ClearFlag (MxU8 p_flag)
 [AI] Clears the given flag in the flags byte. More...
 
void SetUnknown0x10Flag (MxU8 p_flag)
 [AI] Sets the given bit in the unknown (usually internal action suppression) flag byte. More...
 
void ClearUnknown0x10Flag (MxU8 p_flag)
 [AI] Clears the given bit in the unknown flag byte. More...
 
- Public Member Functions inherited from MxEntity
 MxEntity ()
 Default constructor. More...
 
 ~MxEntity () override
 Virtual destructor for MxEntity. More...
 
const char * ClassName () const override
 Returns the class name for type introspection. More...
 
MxBool IsA (const char *p_name) const override
 Checks if the object is of the given class name or a parent type. More...
 
virtual MxResult Create (MxS32 p_entityId, const MxAtomId &p_atomId)
 Initializes the entity from a given entity ID and AtomId. More...
 
MxResult Create (MxDSAction &p_dsAction)
 Initializes the entity from a MxDSAction object. More...
 
MxS32 GetEntityId ()
 Returns the current entity ID. More...
 
MxAtomIdGetAtomId ()
 Returns a reference to the entity AtomId. More...
 
void SetEntityId (MxS32 p_entityId)
 Sets the entity ID to the given value. More...
 
void SetAtomId (const MxAtomId &p_atomId)
 Sets the AtomId to the given value. More...
 
- Public Member Functions inherited from MxCore
 MxCore ()
 [AI] Constructs a new MxCore object and assigns it a unique id. More...
 
virtual ~MxCore ()
 [AI] Virtual destructor. Required for correct polymorphic cleanup in derived classes. More...
 
virtual MxLong Notify (MxParam &p_param)
 [AI] Virtual callback notification mechanism. More...
 
virtual MxResult Tickle ()
 [AI] Called by tickle managers to allow the object to update itself. More...
 
virtual const char * ClassName () const
 [AI] Returns the runtime class name of this object. More...
 
virtual MxBool IsA (const char *p_name) const
 [AI] Checks whether this object's class type or parents match the given name. More...
 
MxU32 GetId ()
 [AI] Gets the unique (per-process) id assigned to this object instance. More...
 

Static Public Member Functions

static const char * GetActorName (MxU8 p_id)
 [AI] Gets the static display name of an actor by ID. More...
 

Protected Attributes

MxFloat m_frequencyFactor
 [AI] The frequency/pitch scaling factor for the actor's sound (default 0 == normal). More...
 
LegoCacheSoundm_sound
 [AI] Pointer to a currently active sound instance played by the actor, if any. More...
 
MxFloat m_unk0x70
 [AI] Unknown float property, likely used for advanced audio/animation control. [AI_SUGGESTED_NAME: m_voicePitchModifier] More...
 
MxU8 m_actorId
 [AI] Unique identifier for this actor, corresponding to enum above. More...
 
- Protected Attributes inherited from LegoEntity
MxU8 m_unk0x10
 [AI] Unknown state/flag, used mainly to guard against repeated actions or manage animation/sound state. [AI] More...
 
MxU8 m_flags
 [AI] Primary entity flags (bitfield); tracks per-entity management status, internal update locks, etc. [AI] More...
 
Mx3DPointFloat m_worldLocation
 [AI] Entity location in world coordinates. [AI] More...
 
Mx3DPointFloat m_worldDirection
 [AI] Entity direction vector in world space (normalized). [AI] More...
 
Mx3DPointFloat m_worldUp
 [AI] Entity up vector in world space (normalized). [AI] More...
 
MxFloat m_worldSpeed
 [AI] World-relative speed (can affect animation/movement logic). [AI] More...
 
LegoROIm_roi
 [AI] Pointer to this entity's currently assigned ROI (3D instance in the world). [AI] More...
 
MxBool m_cameraFlag
 [AI] Set to TRUE if this entity is currently the camera target. [AI] More...
 
MxU8 m_type
 [AI] The entity type (Type enum value). [AI] More...
 
Extra::ActionType m_actionType
 [AI] Action type, parsed from script/extra string (e.g., openram/run/exit); guides Notify() and click logic. [AI] More...
 
char * m_siFile
 [AI] When parsing ACTION command, this is the SI script/filename to execute (owned, heap-allocated). [AI] More...
 
MxS32 m_targetEntityId
 [AI] When parsing ACTION command, this is the target entity ID for the action (or -1 for none). [AI] More...
 
- Protected Attributes inherited from MxEntity
MxS32 m_entityId
 The unique entity ID, typically used for lookup and reference. More...
 
MxAtomId m_atomId
 The AtomId associated with this entity, used for resource and script identification. More...
 

Additional Inherited Members

- Protected Member Functions inherited from LegoEntity
void Init ()
 [AI] Initializes the entity's members to default/neutral values (utility for constructors and resets). [AI] More...
 
void SetWorld ()
 [AI] Registers/attaches this entity to the current world if not already; called on create or location change. [AI] More...
 

Detailed Description

[AI] Represents an actor (character) entity in the LEGO Island 3D world, providing specific actor logic, such as sound, camera, and identity.

Inherits from LegoEntity.

[AI] LegoActor encapsulates information about game actors, including type (character), actor-specific sound control, and actor identity (ID and name). It also implements logic for camera attachment, speed setting, and sound muting based on parsed actions. Typical actor types are Pepper, Mama, Papa, Nick, Laura, and Brickster.

Definition at line 12 of file legoactor.h.

Member Enumeration Documentation

◆ anonymous enum

anonymous enum

[AI] Enumeration of actor IDs for known characters.

Enumerator
c_none 

No actor ([AI])

c_pepper 

Pepper Roni ([AI])

c_mama 

Mama ([AI])

c_papa 

Papa ([AI])

c_nick 

Nick ([AI])

c_laura 

Laura ([AI])

c_brickster 

The Brickster ([AI])

Definition at line 15 of file legoactor.h.

Constructor & Destructor Documentation

◆ LegoActor()

LegoActor::LegoActor ( )

[AI] Constructs new LegoActor, initializes members.

Definition at line 16 of file legoactor.cpp.

◆ ~LegoActor()

LegoActor::~LegoActor ( )
override

[AI] Cleans up LegoActor; stops sound if active.

Definition at line 26 of file legoactor.cpp.

Member Function Documentation

◆ ClassName()

const char * LegoActor::ClassName ( ) const
inlineoverridevirtual

[AI] Gets the class name of this object.

[AI] Used for run-time identification within the engine.

Reimplemented from MxCore.

Reimplemented in LegoAnimActor, LegoExtraActor, LegoPathActor, LegoRaceActor, LegoJetski, LegoRaceCar, LegoCarRaceActor, LegoJetskiRaceActor, Motocycle, Pizza, Pizzeria, RaceCar, SkateBoard, and TowTrack.

Definition at line 33 of file legoactor.h.

◆ GetActorId()

virtual MxU8 LegoActor::GetActorId ( )
inlinevirtual

[AI] Gets this actor's numeric ID, corresponding to a known enumeration/actor.

Definition at line 77 of file legoactor.h.

◆ GetActorName()

const char * LegoActor::GetActorName ( MxU8  p_id)
static

[AI] Gets the static display name of an actor by ID.

[AI] Used for actor name lookup by scripting and user interface.

Parameters
p_idNumeric actor ID as per the enum. [AI]
Returns
Name of the actor, or "none" if not found. [AI]

Definition at line 119 of file legoactor.cpp.

◆ GetSoundFrequencyFactor()

virtual MxFloat LegoActor::GetSoundFrequencyFactor ( )
inlinevirtual

[AI] Returns the current frequency factor for the actor's sound.

Definition at line 60 of file legoactor.h.

◆ IsA()

MxBool LegoActor::IsA ( const char *  p_name) const
inlineoverridevirtual

[AI] Determines if the class is or derives from the given name.

[AI] Checks for "LegoActor" or any base class using IsA.

Parameters
p_nameThe name of the type to test. [AI]
Returns
True if type matches this class or any ancestor. [AI]

Reimplemented from MxCore.

Reimplemented in LegoAnimActor, LegoExtraActor, LegoPathActor, LegoRaceActor, LegoJetski, LegoRaceCar, LegoCarRaceActor, LegoJetskiRaceActor, Motocycle, Pizza, Pizzeria, RaceCar, SkateBoard, and TowTrack.

Definition at line 43 of file legoactor.h.

◆ Mute()

void LegoActor::Mute ( MxBool  p_muted)

[AI] Mutes or unmutes the actor's current sound.

Parameters
p_mutedTrue to mute/stop, false to enable (potentially resumes playback). [AI]

Definition at line 144 of file legoactor.cpp.

◆ ParseAction()

void LegoActor::ParseAction ( char *  p_extra)
overridevirtual

[AI] Parses an action string and applies parsed behaviors to the actor.

[AI] Supports key-value pairs for camera attachment, speed, sound, mute, and visibility. Used by game scripts for dynamic behavior.

Parameters
p_extraThe key-value action string. [AI]

Reimplemented from LegoEntity.

Reimplemented in LegoAnimActor, LegoPathActor, LegoRaceMap, LegoJetski, LegoRaceCar, and RaceSkel.

Definition at line 34 of file legoactor.cpp.

◆ SetActorId()

virtual void LegoActor::SetActorId ( MxU8  p_actorId)
inlinevirtual

[AI] Sets the actor's numeric ID.

Parameters
p_actorIdThe value to set as actor ID. [AI]

Definition at line 81 of file legoactor.h.

◆ SetROI()

void LegoActor::SetROI ( LegoROI p_roi,
MxBool  p_bool1,
MxBool  p_bool2 
)
overridevirtual

[AI] Sets the Region of Interest (ROI, i.e.

visual representation) for the actor, updating actor ID/type if name matches known actor names.

Parameters
p_roiPointer to LegoROI to assign. [AI]
p_bool1If true, perform extra logic (see base class). [AI]
p_bool2If true, perform extra logic (see base class). [AI]

Reimplemented from LegoEntity.

Definition at line 125 of file legoactor.cpp.

◆ SetSoundFrequencyFactor()

virtual void LegoActor::SetSoundFrequencyFactor ( MxFloat  p_frequencyFactor)
inlinevirtual

[AI] Sets the frequency factor for the actor's sound playback (e.g., to alter pitch).

Parameters
p_frequencyFactorThe desired frequency factor. [AI]

Definition at line 64 of file legoactor.h.

◆ VTable0x58()

virtual void LegoActor::VTable0x58 ( MxFloat  p_unk0x70)
inlinevirtual

[AI] Sets a floating point property, unknown usage (possibly animation or audio parameter).

Parameters
p_unk0x70Value to store in m_unk0x70. [AI] [AI_SUGGESTED_NAME: SetVoicePitchModifier]

Definition at line 71 of file legoactor.h.

◆ VTable0x5c()

virtual MxFloat LegoActor::VTable0x5c ( )
inlinevirtual

[AI] Gets the unknown floating point property set by VTable0x58. [AI] [AI_SUGGESTED_NAME: GetVoicePitchModifier]

Definition at line 74 of file legoactor.h.

Member Data Documentation

◆ m_actorId

MxU8 LegoActor::m_actorId
protected

[AI] Unique identifier for this actor, corresponding to enum above.

Definition at line 97 of file legoactor.h.

◆ m_frequencyFactor

MxFloat LegoActor::m_frequencyFactor
protected

[AI] The frequency/pitch scaling factor for the actor's sound (default 0 == normal).

Definition at line 94 of file legoactor.h.

◆ m_sound

LegoCacheSound* LegoActor::m_sound
protected

[AI] Pointer to a currently active sound instance played by the actor, if any.

Definition at line 95 of file legoactor.h.

◆ m_unk0x70

MxFloat LegoActor::m_unk0x70
protected

[AI] Unknown float property, likely used for advanced audio/animation control. [AI_SUGGESTED_NAME: m_voicePitchModifier]

Definition at line 96 of file legoactor.h.


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