FS2_Open
Open source remastering of the Freespace 2 engine
modelanim.cpp File Reference
#include "globalincs/linklist.h"
#include "io/timer.h"
#include "model/model.h"
#include "model/modelanim.h"
#include "network/multi.h"
#include "ship/ship.h"

Go to the source code of this file.

Functions

int model_anim_match_type (char *p)
 
void queued_animation_init (queued_animation *qa)
 
void queued_animation_correct (queued_animation *qa)
 
void model_anim_submodel_trigger_rotate (model_subsystem *psub, ship_subsys *ss)
 
bool subtype_check (model_subsystem *psub, queued_animation *anim_q, int subtype)
 
bool model_anim_start_type (ship_subsys *pss, int animation_type, int subtype, int direction, bool instant)
 
bool model_anim_start_type (ship *shipp, int animation_type, int subtype, int direction, bool instant)
 
int model_anim_instance_get_actual_time (queued_animation *properties)
 Finds the actual amount of time that motion of an animation type will take to stop, not for gameplay purposes but for stuff that is involved in coordinating the animation itself. More...
 
int model_anim_get_actual_time_type (ship *shipp, int animation_type, int subtype)
 
int model_anim_get_actual_time_type (ship_info *sip, int animation_type, int subtype)
 
void model_anim_fix_reverse_times (ship_info *sip)
 
int model_anim_get_time_type (ship_subsys *pss, int animation_type, int subtype)
 
int model_anim_get_time_type (ship *shipp, int animation_type, int subtype)
 How long an animation is going to take to complete. More...
 
void model_anim_set_initial_states (ship *shipp)
 
void model_anim_handle_multiplayer (ship *shipp)
 
bool model_anim_push_and_start_type (int stack_unique_id, ship *shipp, int animation_type, int subtype, int direction, bool instant)
 
bool model_anim_pop_and_start_type (int stack_unique_id)
 

Variables

float flFrametime
 
SCP_vector< triggered_rotationTriggered_rotations
 
char * Animation_type_names [MAX_TRIGGER_ANIMATION_TYPES]
 
SCP_map< int, animation_stackAnimation_map
 

Function Documentation

void model_anim_fix_reverse_times ( ship_info sip)

Definition at line 705 of file modelanim.cpp.

int model_anim_get_actual_time_type ( ship shipp,
int  animation_type,
int  subtype 
)

Definition at line 650 of file modelanim.cpp.

int model_anim_get_actual_time_type ( ship_info sip,
int  animation_type,
int  subtype 
)

Definition at line 682 of file modelanim.cpp.

int model_anim_get_time_type ( ship_subsys pss,
int  animation_type,
int  subtype 
)

Needs to always return a valid timestamp, even if it's just the current one

Definition at line 740 of file modelanim.cpp.

int model_anim_get_time_type ( ship shipp,
int  animation_type,
int  subtype 
)

How long an animation is going to take to complete.

For things that can't happen until animations are done this is for gameplay purposes, this isn't the actual time

Parameters
shipp
animation_type
subtype
Returns
Should already be a valid timestamp

Definition at line 807 of file modelanim.cpp.

void model_anim_handle_multiplayer ( ship shipp)

Handles multiplayer-safe, client-side, animations

Definition at line 863 of file modelanim.cpp.

int model_anim_instance_get_actual_time ( queued_animation properties)

Finds the actual amount of time that motion of an animation type will take to stop, not for gameplay purposes but for stuff that is involved in coordinating the animation itself.

The time it takes to speed up or slow down is v/a in this time the animation covers an angle = to (v^2)/(2a) (for both directions so v^2/a) so wee need the time it takes for the angle moving at a constant velosity to cover theda - v^2/a v*t = theda - (v^2)/(2*a) => t = -(v^2 - 2*a*theda)/(2*a*v) so finally v/a * 2 - (v^2 - 2*a*theda)/(2*a*v) => (3*v^2 + 2*a*theda)/(2*a*v) time = (3*v^2 + 2*a*theda)/(2*a*v)

Definition at line 633 of file modelanim.cpp.

int model_anim_match_type ( char *  p)

Definition at line 38 of file modelanim.cpp.

bool model_anim_pop_and_start_type ( int  stack_unique_id)

Definition at line 928 of file modelanim.cpp.

bool model_anim_push_and_start_type ( int  stack_unique_id,
ship shipp,
int  animation_type,
int  subtype,
int  direction,
bool  instant 
)

Definition at line 914 of file modelanim.cpp.

void model_anim_set_initial_states ( ship shipp)

Definition at line 823 of file modelanim.cpp.

bool model_anim_start_type ( ship_subsys pss,
int  animation_type,
int  subtype,
int  direction,
bool  instant 
)

Definition at line 566 of file modelanim.cpp.

bool model_anim_start_type ( ship shipp,
int  animation_type,
int  subtype,
int  direction,
bool  instant 
)

Definition at line 603 of file modelanim.cpp.

void model_anim_submodel_trigger_rotate ( model_subsystem psub,
ship_subsys ss 
)

Definition at line 403 of file modelanim.cpp.

void queued_animation_correct ( queued_animation qa)

Definition at line 372 of file modelanim.cpp.

void queued_animation_init ( queued_animation qa)

Definition at line 350 of file modelanim.cpp.

bool subtype_check ( model_subsystem psub,
queued_animation anim_q,
int  subtype 
)

Definition at line 536 of file modelanim.cpp.

Variable Documentation

SCP_map<int, animation_stack> Animation_map

Definition at line 912 of file modelanim.cpp.

char* Animation_type_names[MAX_TRIGGER_ANIMATION_TYPES]
Initial value:
=
{
"initial",
"docking-stage-1",
"docking-stage-2",
"docking-stage-3",
"docked",
"primary-bank",
"secondary-bank",
"fighterbay",
"afterburner",
"turret-firing",
"scripted",
"turret-fired"
}

Definition at line 22 of file modelanim.cpp.

float flFrametime

Definition at line 22 of file fredstubs.cpp.

SCP_vector<triggered_rotation> Triggered_rotations

Definition at line 20 of file modelanim.cpp.