Alchemy
Loading...
Searching...
No Matches

MotionObject Struct Reference

An effect object that moves and draws one sprite: its position, scale, velocity and target, and its per-frame update. More...

#include <battle/motobj.h>

Data Fields

u8 unk00 [0x06]
 ScriptMotionObject's script and scriptCursor.
u16 angle
 1/65536 turns
s32 x
 16.16 fixed-point pixels
s32 y
 16.16 fixed-point pixels
s32 z
 16.16 fixed-point pixels
u8 unk14 [0x04]
 FieldActor's terrainHeight, the ground's y.
s32 scaleX
 16.16 fixed point, 0x10000 full size
s32 scaleY
 16.16 fixed point, 0x10000 full size
u16 height
 half the sprite's box height; FieldActor's radius
u8 unk22 [0x02]
 FieldActor's terrainId and priorityFlags.
s32 velocityX
 16.16 fixed-point pixels per frame
s32 velocityY
 16.16 fixed-point pixels per frame
s32 velocityZ
 16.16 fixed-point pixels per frame
s32 speedLimit
 16.16 fixed-point pixels per frame
s32 acceleration
 Horizontal speed gained each frame towards the target, or lost braking without one, in 16.16 fixed-point pixels per frame.
s32 targetX
 16.16 fixed-point pixels; 0x80000000 for no target
s32 targetY
 16.16 fixed-point pixels
s32 targetZ
 16.16 fixed-point pixels
s32 verticalMotionPhase
 With motionFlags bit 1, the 16.16 share of velocityY kept on a bounce; with bit 2, the float's phase, stepped each frame (ScriptMotionObject's vertical).
s32 verticalMotionStrength
 Gravity: taken from velocityY each frame above the ground with motionFlags bit 1, in 16.16 fixed-point pixels per frame; with bit 2, it also scales the float.
u8 unk4c [0x04]
 FieldActor's riseBaseY.
void * records
 one sprite, or a table of up to four (recordStorageKind)
u8 recordStorageKind
 bits: 3..0 RECORDS_NONE, RECORDS_SINGLE or RECORDS_TABLE
u8 motionFlags
 bits: 4 no terrain slowdown | 3 bigger float | 2 floats | 1 falls | 0 follows terrain
u8 unk56 [0x02]
 ScriptMotionObject's arrivalAxis and unk57.
u8 snapToTarget
 nonzero: lands exactly on the target, else brakes in
u8 unk59
 FieldActor's collisionFlags; battle units set 3.
u8 autoFaceMotion
 bit 0 turns the object to face where it moves
u8 unk5b [0x11]
 FieldActor's paused, timer, linkedObject and the bytes between; not named by TBS code through this view.
void(*) update (union FieldObject *object)
 run first each frame

Detailed Description

An effect object that moves and draws one sprite: its position, scale, velocity and target, and its per-frame update.

It is one of the object slots Object_CreateFar hands out, the same object FieldActor and ScriptMotionObject describe; the notes name their fields at the same offsets.

Definition at line 20 of file motobj.h.

Field Documentation

◆ unk00

u8 MotionObject::unk00[0x06]

ScriptMotionObject's script and scriptCursor.

Definition at line 21 of file motobj.h.

◆ angle

◆ x

s32 MotionObject::x

16.16 fixed-point pixels

Definition at line 23 of file motobj.h.

Referenced by BattleEffect_RunFallbackObjectTransition(), BattleFx_RunAngledApproachPhases(), BattleFx_RunAnnihilation(), BattleFx_RunAstralBlast(), BattleFx_RunBeamSequence(), BattleFx_RunBreak(), BattleFx_RunBurstScene(), BattleFx_RunCastingImpact(), BattleFx_RunCybele(), BattleFx_RunDeathPlunge(), BattleFx_RunDjinnBeams(), BattleFx_RunDjinnHeal(), BattleFx_RunDjinniEntrance(), BattleFx_RunDrain(), BattleFx_RunFire(), BattleFx_RunFroth(), BattleFx_RunGatheringLights(), BattleFx_RunGround(), BattleFx_RunHaunt(), BattleFx_RunHealingMotes(), BattleFx_RunHelmSplitter(), BattleFx_RunLobbedShells(), BattleFx_RunMoteFountain(), BattleFx_RunOrbitingSkulls(), BattleFx_RunOrbitingSpirals(), BattleFx_RunPlanetDiver(), BattleFx_RunProcne(), BattleFx_RunProjectileVolley(), BattleFx_RunQuake(), BattleFx_RunRingAndSparkScene(), BattleFx_RunRushingStrike(), BattleFx_RunShiningStar(), BattleFx_RunSleep(), BattleFx_RunStatBoost(), BattleFx_RunStatReduction(), BattleFx_RunStreakVolley(), BattleFx_RunTargetBursts(), BattleFx_RunTargetMotes(), BattleFx_RunTargetStrike(), BattleFx_RunVolcano(), BattleFx_SetApproachMotion(), BattleFx_SpawnItemBreakMode1(), BattleFx_SpawnItemBreakMode3(), BattleFx_SpawnRadialParticleRing(), BattleFx_StartItemBreak(), BattleFx_UpdateRadialBurst(), BattleMotion_ApplyPairMidpoint(), BattleMotion_ApproachTarget(), BattleMotion_InterpolatePosition(), BattleMotion_ProjectConditionalPosition(), BattleMotion_ProjectPosition(), BattleMotion_ProjectScaledPosition(), BattleObjMake(), BattlePlacement_GetStepPair(), BattlePres_RunPsynergyCast(), BattlePres_SetupTransitionAtPairMidpoint(), BattleUnit_ProjectToScreen(), Djinn_RunJupiterJoinEffect(), FieldFx_RunCatch(), FieldFx_RunLiftOnTarget(), SpawnHeavyImpactEffect(), and UpdateRisingParticleBurst().

◆ y

◆ z

s32 MotionObject::z

16.16 fixed-point pixels

Definition at line 25 of file motobj.h.

Referenced by BattleEffect_RunFallbackObjectTransition(), BattleFx_RunAngledApproachPhases(), BattleFx_RunAnnihilation(), BattleFx_RunAstralBlast(), BattleFx_RunBeamSequence(), BattleFx_RunBreak(), BattleFx_RunBurstScene(), BattleFx_RunCastingImpact(), BattleFx_RunCybele(), BattleFx_RunDeathPlunge(), BattleFx_RunDjinnBeams(), BattleFx_RunDjinnHeal(), BattleFx_RunDjinniEntrance(), BattleFx_RunDrain(), BattleFx_RunFire(), BattleFx_RunFroth(), BattleFx_RunGatheringLights(), BattleFx_RunGround(), BattleFx_RunHaunt(), BattleFx_RunHealingMotes(), BattleFx_RunHelmSplitter(), BattleFx_RunLobbedShells(), BattleFx_RunMoteFountain(), BattleFx_RunOrbitingSkulls(), BattleFx_RunOrbitingSpirals(), BattleFx_RunPlanetDiver(), BattleFx_RunProcne(), BattleFx_RunProjectileVolley(), BattleFx_RunQuake(), BattleFx_RunRingAndSparkScene(), BattleFx_RunRushingStrike(), BattleFx_RunShiningStar(), BattleFx_RunSleep(), BattleFx_RunStatBoost(), BattleFx_RunStatReduction(), BattleFx_RunStreakVolley(), BattleFx_RunTargetBursts(), BattleFx_RunTargetMotes(), BattleFx_RunTargetStrike(), BattleFx_SetApproachMotion(), BattleFx_SpawnItemBreakMode1(), BattleFx_SpawnItemBreakMode3(), BattleFx_SpawnRadialParticleRing(), BattleFx_StartItemBreak(), BattleFx_UpdateRadialBurst(), BattleMotion_ApplyPairMidpoint(), BattleMotion_ApproachTarget(), BattleMotion_InterpolatePosition(), BattleMotion_ProjectPosition(), BattlePres_RunAttack(), BattlePres_RunPlainAttack(), BattlePres_RunPsynergyCast(), BattlePres_SetupTransitionAtPairMidpoint(), Djinn_RunJupiterJoinEffect(), FieldFx_RunCatch(), FieldFx_RunLiftOnTarget(), ObjMotRst(), SpawnHeavyImpactEffect(), Summon_LayoutPositions(), and UpdateRisingParticleBurst().

◆ unk14

u8 MotionObject::unk14[0x04]

FieldActor's terrainHeight, the ground's y.

Definition at line 26 of file motobj.h.

◆ scaleX

◆ scaleY

◆ height

u16 MotionObject::height

half the sprite's box height; FieldActor's radius

Definition at line 29 of file motobj.h.

Referenced by BattleFx_RunBreak(), BattleFx_RunCastingImpact(), BattleFx_RunGatheringLights(), BattleFx_RunProjectileVolley(), and BattleFx_RunStatBoost().

◆ unk22

u8 MotionObject::unk22[0x02]

FieldActor's terrainId and priorityFlags.

Definition at line 30 of file motobj.h.

◆ velocityX

s32 MotionObject::velocityX

16.16 fixed-point pixels per frame

Definition at line 31 of file motobj.h.

Referenced by BattleFx_RunCastingImpact(), and BattleFx_RunPlanetDiver().

◆ velocityY

◆ velocityZ

s32 MotionObject::velocityZ

16.16 fixed-point pixels per frame

Definition at line 33 of file motobj.h.

Referenced by BattleFx_RunCastingImpact().

◆ speedLimit

◆ acceleration

◆ targetX

s32 MotionObject::targetX

16.16 fixed-point pixels; 0x80000000 for no target

Definition at line 38 of file motobj.h.

Referenced by BattleMotion_ApplyPairMidpoint(), and BattleMotion_ApplyVariantMotion().

◆ targetY

s32 MotionObject::targetY

16.16 fixed-point pixels

Definition at line 39 of file motobj.h.

◆ targetZ

s32 MotionObject::targetZ

16.16 fixed-point pixels

Definition at line 40 of file motobj.h.

Referenced by BattleMotion_ApplyPairMidpoint().

◆ verticalMotionPhase

s32 MotionObject::verticalMotionPhase

With motionFlags bit 1, the 16.16 share of velocityY kept on a bounce; with bit 2, the float's phase, stepped each frame (ScriptMotionObject's vertical).

Definition at line 44 of file motobj.h.

Referenced by BattleMotion_InterpolatePosition().

◆ verticalMotionStrength

s32 MotionObject::verticalMotionStrength

Gravity: taken from velocityY each frame above the ground with motionFlags bit 1, in 16.16 fixed-point pixels per frame; with bit 2, it also scales the float.

Definition at line 48 of file motobj.h.

Referenced by BattleFx_RunAstralBlast(), BattleFx_RunCastingImpact(), BattleFx_RunCondemn(), BattleFx_RunDeathPlunge(), BattleFx_RunNereid(), BattleFx_RunPlanetDiver(), and BattleMotion_InterpolatePosition().

◆ unk4c

u8 MotionObject::unk4c[0x04]

FieldActor's riseBaseY.

Definition at line 49 of file motobj.h.

◆ records

◆ recordStorageKind

u8 MotionObject::recordStorageKind

◆ motionFlags

u8 MotionObject::motionFlags

bits: 4 no terrain slowdown | 3 bigger float | 2 floats | 1 falls | 0 follows terrain

Definition at line 55 of file motobj.h.

Referenced by BattleFx_StartItemBreak(), and BattleMotion_ApproachTarget().

◆ unk56

u8 MotionObject::unk56[0x02]

ScriptMotionObject's arrivalAxis and unk57.

Definition at line 56 of file motobj.h.

◆ snapToTarget

u8 MotionObject::snapToTarget

nonzero: lands exactly on the target, else brakes in

Definition at line 57 of file motobj.h.

Referenced by BattleFx_RunCondemn(), BattleFx_RunDeathPlunge(), and BattleFx_RunPlanetDiver().

◆ unk59

u8 MotionObject::unk59

FieldActor's collisionFlags; battle units set 3.

Definition at line 58 of file motobj.h.

◆ autoFaceMotion

u8 MotionObject::autoFaceMotion

◆ unk5b

u8 MotionObject::unk5b[0x11]

FieldActor's paused, timer, linkedObject and the bytes between; not named by TBS code through this view.

Definition at line 62 of file motobj.h.

◆ update

void(*) MotionObject::update(union FieldObject *object)

run first each frame

Definition at line 63 of file motobj.h.

Referenced by BattleFx_StartItemBreak(), and Djinn_RunJupiterJoinEffect().