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 | |
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.
| u8 MotionObject::unk00[0x06] |
ScriptMotionObject's script and scriptCursor.
| u16 MotionObject::angle |
1/65536 turns
Definition at line 22 of file motobj.h.
Referenced by BattleFx_FindMatchingEvent(), BattleFx_RunCastingImpact(), BattleFx_RunHelmSplitter(), BattleFx_RunProcne(), BattleFx_RunTargetMotes(), BattleFx_SpawnItemBreakMode1(), BattleFx_SpawnItemBreakMode3(), BattleFx_StartItemBreak(), BattlePres_RunPsynergyCast(), Field_FindItemEvent(), FieldFx_RunCatch(), FieldFx_RunLiftOnTarget(), and UpdateRisingParticleBurst().
| 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().
| s32 MotionObject::y |
16.16 fixed-point pixels
Definition at line 24 of file motobj.h.
Referenced by BattleActor_UpdateSpritePriorities(), BattleEffect_RunFallbackObjectTransition(), BattleFx_RunAngledApproachPhases(), BattleFx_RunAnnihilation(), BattleFx_RunAstralBlast(), BattleFx_RunBeamSequence(), BattleFx_RunBurstScene(), BattleFx_RunCastingImpact(), BattleFx_RunCybele(), BattleFx_RunDeathPlunge(), BattleFx_RunDrain(), BattleFx_RunFire(), BattleFx_RunFroth(), BattleFx_RunGatheringLights(), BattleFx_RunMoteFountain(), BattleFx_RunOrbitingSkulls(), BattleFx_RunOrbitingSpirals(), BattleFx_RunPlanetDiver(), BattleFx_RunProcne(), BattleFx_RunProjectileVolley(), BattleFx_RunQuake(), BattleFx_RunRingAndSparkScene(), BattleFx_RunRushingStrike(), BattleFx_RunShiningStar(), BattleFx_RunStatReduction(), BattleFx_RunStreakVolley(), BattleFx_RunTargetMotes(), BattleFx_RunTargetStrike(), BattleFx_SpawnItemBreakMode1(), BattleFx_SpawnItemBreakMode3(), BattleFx_SpawnRadialParticleRing(), BattleFx_StartItemBreak(), BattleFx_UpdateRadialBurst(), BattleMotion_ApplyVariantMotion(), BattleMotion_ProjectPosition(), BattleObjMake(), BattlePlacement_GetStepPair(), Djinn_RunJupiterJoinEffect(), FieldFx_RunCatch(), FieldFx_RunLiftOnTarget(), SpawnHeavyImpactEffect(), and UpdateRisingParticleBurst().
| 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().
| u8 MotionObject::unk14[0x04] |
FieldActor's terrainHeight, the ground's y.
| s32 MotionObject::scaleX |
16.16 fixed point, 0x10000 full size
Definition at line 27 of file motobj.h.
Referenced by BattleEffect_RunFallbackObjectTransition(), BattleFx_SetObjectAlternatingWords(), BattleFx_ShrinkObjectScaleUntilHalf(), BattleFx_SnapScaleToFull(), BattleFx_SpawnItemBreakMode1(), BattleFx_SpawnItemBreakMode3(), BattleFx_StartItemBreak(), and UpdateRisingParticleBurst().
| s32 MotionObject::scaleY |
16.16 fixed point, 0x10000 full size
Definition at line 28 of file motobj.h.
Referenced by BattleEffect_RunFallbackObjectTransition(), BattleFx_RunDeathPlunge(), BattleFx_SetObjectAlternatingWords(), BattleFx_ShrinkObjectScaleUntilHalf(), BattleFx_SnapScaleToFull(), BattleFx_SpawnItemBreakMode1(), BattleFx_SpawnItemBreakMode3(), BattleFx_StartItemBreak(), and UpdateRisingParticleBurst().
| 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().
| u8 MotionObject::unk22[0x02] |
FieldActor's terrainId and priorityFlags.
| 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().
| s32 MotionObject::velocityY |
16.16 fixed-point pixels per frame
Definition at line 32 of file motobj.h.
Referenced by BattleFx_RunAstralBlast(), BattleFx_RunCastingImpact(), BattleFx_RunCondemn(), BattleFx_RunDeathPlunge(), BattleFx_RunNereid(), BattleFx_RunParticleStreams(), BattleFx_RunPlanetDiver(), BattleFx_RunQuake(), and BattleMotion_InterpolatePosition().
| s32 MotionObject::velocityZ |
16.16 fixed-point pixels per frame
Definition at line 33 of file motobj.h.
Referenced by BattleFx_RunCastingImpact().
| s32 MotionObject::speedLimit |
16.16 fixed-point pixels per frame
Definition at line 34 of file motobj.h.
Referenced by BattleFx_RunAstralBlast(), BattleFx_RunCondemn(), BattleFx_RunDeathPlunge(), BattleFx_RunPlanetDiver(), BattleFx_SpawnItemBreakMode1(), BattleFx_SpawnItemBreakMode3(), BattleFx_StartItemBreak(), and BattleMotion_InterpolatePosition().
| s32 MotionObject::acceleration |
Horizontal speed gained each frame towards the target, or lost braking without one, in 16.16 fixed-point pixels per frame.
Definition at line 37 of file motobj.h.
Referenced by BattleFx_InitializeRisingObject(), BattleFx_RunAstralBlast(), BattleFx_RunCastingImpact(), BattleFx_RunCondemn(), BattleFx_RunDeathPlunge(), BattleFx_RunPlanetDiver(), BattleFx_SpawnItemBreakMode1(), BattleFx_SpawnItemBreakMode3(), BattleFx_StartItemBreak(), BattleMotion_InitializeObject(), BattleMotion_InterpolatePosition(), BattleMotion_ResetObjectAtScaledAnchor(), BattleMotion_SetObjectPosition(), BattleMotion_SetupEscapeObject(), and ObjMotRst().
| 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().
| s32 MotionObject::targetZ |
16.16 fixed-point pixels
Definition at line 40 of file motobj.h.
Referenced by BattleMotion_ApplyPairMidpoint().
| 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().
| 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().
| u8 MotionObject::unk4c[0x04] |
FieldActor's riseBaseY.
| void* MotionObject::records |
one sprite, or a table of up to four (recordStorageKind)
Definition at line 50 of file motobj.h.
Referenced by BattleActor_UpdateSpritePriorities(), BattleFx_SpawnItemBreakMode3(), BattleMotion_SetMode5AndActivateSlot(), BattleMotion_SpawnSlotEffectAndWait(), BattlePres_RunUnitAction(), GetMotionRecord(), ResetBattleObjectRecordGroups(), and Ui_RunOwnerStatusScreen().
| u8 MotionObject::recordStorageKind |
bits: 3..0 RECORDS_NONE, RECORDS_SINGLE or RECORDS_TABLE
Definition at line 52 of file motobj.h.
Referenced by Animation_ApplyChildPalette(), BattleActor_SpawnObjectsForList(), BattleActor_UpdateSpritePriorities(), BattleMotion_SpawnSlotEffectAndWait(), and BattlePres_SetActorRecordMode().
| 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().
| u8 MotionObject::unk56[0x02] |
ScriptMotionObject's arrivalAxis and unk57.
| 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().
| u8 MotionObject::unk59 |
FieldActor's collisionFlags; battle units set 3.
| u8 MotionObject::autoFaceMotion |
bit 0 turns the object to face where it moves
Definition at line 59 of file motobj.h.
Referenced by BattleFx_RunAstralBlast(), BattleFx_RunCondemn(), BattleFx_RunDeathPlunge(), BattleFx_RunPlanetDiver(), BattleFx_SpawnItemBreakMode1(), and BattleMotion_InterpolatePosition().
| u8 MotionObject::unk5b[0x11] |
FieldActor's paused, timer, linkedObject and the bytes between; not named by TBS code through this view.
| 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().