|
Wing Commander II
Reconstructed Win32 source (1996)
|
Ship velocity limits, vector arithmetic and orientation geometry. More...
#include "game.h"Go to the source code of this file.
Variables | |
| int | g_nFacingRangeQueryCount = 0 |
| int | g_anCloakVisibilityPattern [20] |
| int | g_abObjectShapeOwned [SPACE_OBJECT_COUNT] = { 0 } |
| FixedVector | g_2_vNormalizedToTgt |
| int | g_nUnusedGeomWord [3] |
Ship velocity limits, vector arithmetic and orientation geometry.
Definition in file geom.c.
| int AbsInt | ( | int | v | ) |
Definition at line 151 of file geom.c.
References AbsInt().
Referenced by AbsInt(), and control_speed().
| void AddFixedVectors | ( | const FixedVector * | left, |
| const FixedVector * | right, | ||
| FixedVector * | sum ) |
Definition at line 211 of file geom.c.
References AddFixedVectors(), FixedVector::x, FixedVector::y, and FixedVector::z.
Referenced by accelerate_and_move_object(), AddFixedVectors(), animate_object(), apply_force_to_object(), apply_force_to_objects_center(), approach(), auto_pilot_sequence(), capital_ship_strike_mission(), chase_location(), compute_formation_destination(), ComputePointAheadOfObject(), ComputePointBehindObject(), Create_explosion_debris(), Create_ship_hit_debris(), DrawNavHazardMarker(), find_squad_center(), fire_weapon(), FireTargetCameraGuns(), goto_formation(), init_formation_burst(), init_hazard(), init_ship(), launch_object(), locate_ship(), make_shard(), Msit_n_spin(), new_view(), object_collision(), onboard_explosion(), position_relative(), random_radial(), real_crash_time(), servicetrack(), set_eye_direction_and_position(), set_sphere_point(), SetFleetOverviewView(), SpawnCapitalFlakProjectile(), SpawnFlakBurst(), start_dust(), steer_away_from_object(), steer_away_from_predicted_object(), update_objects_in_space(), update_star_field(), UpdateShipTurretGuns(), and UpdateTargetLeadIndicator().
| void alter_pitch | ( | short | angle, |
| short | obj ) |
Definition at line 504 of file geom.c.
References alter_pitch(), fix_objects_ijk(), g_aShipForwardVector, g_aShipUpVector, and rotate_about_i().
Referenced by alter_pitch(), InitializeConstellationObject(), make_shard(), rotate_object(), set_background_objects_rotation(), and Set_up_ship_info().
| void alter_roll | ( | short | angle, |
| short | obj ) |
Definition at line 520 of file geom.c.
References alter_roll(), fix_objects_ijk(), g_aShipRightVector, g_aShipUpVector, and rotate_about_k().
Referenced by alter_roll(), InitializeConstellationObject(), rotate_object(), and Set_up_ship_info().
| void alter_yaw | ( | short | angle, |
| short | obj ) |
Definition at line 512 of file geom.c.
References alter_yaw(), fix_objects_ijk(), g_aShipForwardVector, g_aShipRightVector, and rotate_about_j().
Referenced by alter_yaw(), InitializeConstellationObject(), make_shard(), rotate_object(), set_background_objects_rotation(), and Set_up_ship_info().
| void apply_force_to_object | ( | FixedVector * | point, |
| FixedVector * | force, | ||
| short | obj ) |
Definition at line 908 of file geom.c.
References AddFixedVectors(), apply_force_to_object(), check_for_lost_control(), ClampTo30(), DivideFixed(), g_acObjectType, g_aeObjectClass, g_anObjectPitchRotation, g_anObjectRollRotation, g_anObjectYawRotation, g_aObjectTypeData, g_aShipVelocity, g_asObjectCollisionRadius, MultiplyFixed(), OBJECT_CLASS_SHIP, PlanarMagnitude(), ObjectTypeData::radarRadius, transform_to_objects_frame(), FixedVector::x, FixedVector::y, and FixedVector::z.
Referenced by apply_force_to_object(), and object_collision().
| void apply_force_to_objects_center | ( | FixedVector * | force, |
| short | obj ) |
Definition at line 895 of file geom.c.
References AddFixedVectors(), apply_force_to_objects_center(), divide_vector(), g_acObjectType, g_aObjectTypeData, and g_aShipVelocity.
Referenced by apply_force_to_objects_center(), explosion_shock_wave(), and UpdateTargetCameraObject().
| short check_for_collision | ( | short | obj | ) |
Definition at line 769 of file geom.c.
References check_for_collision(), ComputeVectorDelta(), g_aeObjectClass, g_aShipPosition, g_asObjectCollisionRadius, g_vCollisionDelta, IsVectorWithinRange(), OBJECT_CLASS_PROJECTILE, OBJECT_CLASS_SHIP, and SPACE_LAST_MOVING_OBJECT.
Referenced by check_for_collision(), and object_collision().
| void child_object | ( | short | hardpoint, |
| short | child, | ||
| short | parent ) |
Definition at line 822 of file geom.c.
References child_object(), g_acObjectOwner, g_aShipPosition, and position_child().
Referenced by child_object(), and fire_weapon().
| short ChooseRandomSignedMagnitude | ( | short | minimum, |
| short | maximum, | ||
| short | allowNegative ) |
Definition at line 253 of file geom.c.
References ChooseRandomSignedMagnitude(), and RandomInRange().
Referenced by ChooseRandomSignedMagnitude(), and MakeRandomVectorFixed().
| void ClampTo30 | ( | short * | p | ) |
Definition at line 1011 of file geom.c.
References ClampTo30().
Referenced by apply_force_to_object(), ClampTo30(), and rotational_acceleration().
| void ClampVectorTo30 | ( | short * | p | ) |
Definition at line 1001 of file geom.c.
References ClampVectorTo30().
Referenced by ClampVectorTo30(), and rotate_object().
| void ComputeVectorDelta | ( | FixedVector * | from, |
| FixedVector * | to, | ||
| FixedVector * | delta ) |
Definition at line 229 of file geom.c.
References ComputeVectorDelta(), FixedVector::x, FixedVector::y, and FixedVector::z.
Referenced by accelerate_and_move_object(), auto_pilot_sequence(), capital_ship_strike_mission(), check_for_collision(), ComputeVectorDelta(), distance_between_points(), distance_from_point(), draw_3d_scanner(), draw_nav_pointer(), explosion_shock_wave(), facing_to_object(), fire(), fire_weapon(), GetShipDistanceToNavPoint(), hemisphere(), init_formation_burst(), IsPointWithinRange(), new_view(), object_collision(), PlaySfxWaveFileByNumber(), point_at(), point_capital_ship_at_object(), point_ship_at_point(), real_crash_time(), room_for_me(), send_at_point(), servicetrack(), set_eye_direction_and_position(), set_objective_range(), SetFleetOverviewView(), ships_within_range(), sound_effect(), SpawnCapitalFlakProjectile(), steer_away_from_object(), steer_away_from_predicted_object(), transform_objects_to_your_view(), update_objective_location(), update_star_field(), and UpdateTargetLeadIndicator().
| void ConvertFixedVectorToShortVector | ( | const FixedVector * | source, |
| ShortVector * | destination ) |
Definition at line 307 of file geom.c.
References ConvertFixedVectorToShortVector(), FixedVector::x, ShortVector::x, FixedVector::y, ShortVector::y, FixedVector::z, and ShortVector::z.
Referenced by ConvertFixedVectorToShortVector().
| void copy_frame | ( | short | source, |
| short | destination ) |
Definition at line 470 of file geom.c.
References copy_frame(), g_aShipForwardVector, g_aShipRightVector, and g_aShipUpVector.
Referenced by auto_pilot_sequence(), chase_location(), copy_frame(), fire_weapon(), FireTargetCameraGuns(), generate_stars(), goto_formation(), new_view(), RunSpaceFlight(), set_eye_direction_and_position(), set_formation_position(), ShipExplosion(), try_far_spot(), and update_star_field().
| void damage_ion_drive | ( | short | ship, |
| short | amount, | ||
| short | maximum ) |
Definition at line 53 of file geom.c.
References damage_ion_drive(), g_acShipIonDriveDamage, MaxShort(), MinShort(), and recalc_max_velocity().
Referenced by damage_ion_drive(), internal_damage(), repair_internal_damage(), and your_internal_damage().
| short distance_between_points | ( | const FixedVector * | from, |
| const FixedVector * | to ) |
Definition at line 528 of file geom.c.
References ComputeVectorDelta(), distance_between_points(), FixedToShortSaturating(), and Vector_magnitude().
Referenced by auto_pilot_sequence(), distance_between_points(), init_hazard(), and UpdateTargetCameraObject().
| short distance_from_object | ( | short | obj, |
| short | other ) |
Definition at line 547 of file geom.c.
References distance_from_object(), distance_from_point(), g_aShipPosition, and g_asObjectCollisionRadius.
Referenced by abandoned(), any_enemy(), approach_and_engage(), attacker_in_range(), auto_pilot_sequence(), build_target_list(), capital_ship_strike_mission(), chaff_intelligence(), cleanup_objectives(), coming_home(), cruise_home(), defend_mission(), distance_from_object(), enemy_within_range(), escort_mission(), FF_missile_intelligence(), FindNearestMissileTargetingObject(), fire_turrets(), fire_weapon(), heat_seeking_missile_intelligence(), house_keep_objects(), imperial_formation(), in_danger(), mine_intelligence(), overlay_head_up_display(), rendezvous_mission(), report_kilrathi_rout(), return_to_buddy(), return_to_master(), room_for_me(), run_away(), scan_for_enemy(), select_target(), update_missile_warning(), UpdateTargetCameraTracking(), and UpdateTargetLeadIndicator().
| short distance_from_point | ( | short | obj, |
| const FixedVector * | point ) |
Definition at line 538 of file geom.c.
References ComputeVectorDelta(), distance_from_point(), FixedToShortSaturating(), g_aShipPosition, g_asObjectCollisionRadius, g_vToTarget, and Vector_magnitude().
Referenced by auto_pilot_sequence(), auto_pilot_valid(), cruise_home(), cruise_to_destination(), dist_from_home(), distance_from_object(), distance_from_point(), get_facing_range_from_point(), orbit_sphere(), scan_for_enemy(), UpdateShipTurretGuns(), and UpdateTargetLeadIndicator().
| void divide_vector | ( | FixedVector * | vector, |
| int | divisor, | ||
| FixedVector * | result ) |
Definition at line 245 of file geom.c.
References divide_vector(), DivideFixed(), FixedVector::x, FixedVector::y, and FixedVector::z.
Referenced by apply_force_to_objects_center(), Create_explosion_debris(), divide_vector(), find_squad_center(), and set_eye_direction_and_position().
| int dot_product | ( | const FixedVector * | left, |
| const FixedVector * | right ) |
Definition at line 316 of file geom.c.
References dot_product(), MultiplyFixed(), FixedVector::x, FixedVector::y, and FixedVector::z.
Referenced by accelerate_and_move_object(), dot_product(), facing_to_object(), get_facing_range_from_object(), get_facing_range_from_point(), get_right_shape(), inflict_damage(), match_roll_orientation(), servicetrack(), set_background_objects_rotation(), sound_effect(), transform_to_objects_frame(), UpdateShipTurretGuns(), vector_angle(), and vector_length_in_dir().
| void drain_fuel | ( | short | ship, |
| short | amount ) |
Definition at line 45 of file geom.c.
References drain_fuel(), g_anShipFuel, and recalc_max_velocity().
Referenced by accelerate_and_move_object(), drain_fuel(), housekeep_power_plant_and_fuel(), internal_damage(), and your_internal_damage().
| short equ_vector | ( | const FixedVector * | left, |
| const FixedVector * | right ) |
Definition at line 182 of file geom.c.
References equ_vector(), FixedVector::x, FixedVector::y, and FixedVector::z.
Referenced by auto_pilot_sequence(), auto_pilot_valid(), cruise_home(), cruise_to_destination(), equ_vector(), RecordCannedSceneObjectState(), and TryBeginStarSystemJump().
| short facing_to_object | ( | short | obj, |
| FixedVector * | point ) |
Definition at line 591 of file geom.c.
References ComputeVectorDelta(), dot_product(), facing_to_object(), g_aShipForwardVector, g_aShipPosition, g_nFacingToTarget, and NormalizeFixedVector().
Referenced by facing_to_object(), and imperial_formation().
| void FillFixedVectorWithRandomComponents | ( | short | limit, |
| FixedVector * | vector ) |
Definition at line 272 of file geom.c.
References FillFixedVectorWithRandomComponents(), and MakeRandomVectorFixed().
Referenced by animate_object(), Create_explosion_debris(), Create_ship_hit_debris(), FillFixedVectorWithRandomComponents(), random_radial(), and start_dust().
| short find_vacant_3d_object | ( | void | ) |
Definition at line 841 of file geom.c.
References find_vacant_3d_object(), g_aeObjectClass, g_asObjectScreenX, OBJECT_CLASS_NULL, and SPACE_LAST_MOVING_OBJECT.
Referenced by animate_object(), Create_explosion_debris(), Create_ship_hit_debris(), draw_nav_pointer(), find_vacant_3d_object(), init_constellation(), make_hazard(), make_shard(), new_object(), onboard_explosion(), place_exhaust_on_ships(), ShipExplosion(), ToggleTargetCameraTracking(), unwarp(), and warp().
| void fix_objects_ijk | ( | short | obj | ) |
Definition at line 481 of file geom.c.
References fix_objects_ijk(), g_aShipForwardVector, g_aShipRightVector, g_aShipUpVector, NormalizeFixedVector(), and vector_cross_product().
Referenced by alter_pitch(), alter_roll(), alter_yaw(), fix_objects_ijk(), make_shard(), new_view(), point_at(), set_eye_direction_and_position(), update_objects_in_space(), and UpdateFleetOverviewCameraRotation().
| short FixedToShortSaturating | ( | int | value | ) |
Definition at line 122 of file geom.c.
References FixedToShortSaturating().
Referenced by capital_ship_strike_mission(), chase_location(), control_speed(), distance_between_points(), distance_from_point(), explosion_shock_wave(), FixedToShortSaturating(), GetShipDistanceToNavPoint(), GetVectorMagnitude(), goto_location(), real_crash_time(), real_velocity(), and update_objective_location().
| void get_facing_range_from_object | ( | short | obj, |
| short | other ) |
Definition at line 578 of file geom.c.
References dot_product(), g_2_vNormalizedToTgt, g_aShipForwardVector, g_aShipPosition, g_asObjectCollisionRadius, g_nTargetFacing, g_nTargetRange, get_facing_range_from_object(), get_facing_range_from_point(), and negate_vector().
Referenced by being_tailed(), BuildCommunicationCommandMenu(), capital_ship_strike_mission(), cruise_to_destination(), fire(), futurion_intelligence(), get_facing_range_from_object(), heat_seeking_missile_intelligence(), intelligence_events(), Mkill_missile(), object_intelligence(), patrol_area(), prepare_for_jump(), scan_for_enemy(), tanker_intelligence(), target_locking(), and UpdateSavedTorpedoTargetLock().
| void get_facing_range_from_point | ( | short | obj, |
| const FixedVector * | point ) |
Definition at line 562 of file geom.c.
References distance_from_point(), dot_product(), g_2_vNormalizedToTgt, g_aShipForwardVector, g_asObjectCollisionRadius, g_nFacingRangeQueryCount, g_nFacingToTarget, g_nTargetRange, g_vToTarget, get_facing_range_from_point(), and NormalizeFixedVector().
Referenced by chase_location(), get_facing_range_from_object(), get_facing_range_from_point(), goto_formation(), goto_location(), patrol_area(), and prevent_collision().
| void get_right_shape | ( | short | obj, |
| FixedVector * | direction ) |
Definition at line 1181 of file geom.c.
References ArcCos(), CheckHeapBlockSignature(), DIRECTION_VIEW_COUNT, dot_product(), EYE_OBJECT, FetchDiskPacketRetrying(), free_view_buffer(), FreePacketAndClear(), g_137_aDirectionViewUpVectorArray, g_27_stViewScratchInfo, g_9_aDirectionLookRightVector, g_abObjectShapeOwned, g_acDirectionShapeFlip, g_acDirectionShapeFrame, g_acObjectType, g_aeObjectClass, g_aObjectResourceSlots, g_aObjectTypeData, g_apObjectShape, g_apPacketReferenceGroups, g_aShipUpVector, g_asLoadedShipViewFrame, g_asObjectFlip, g_asObjectScreenAngle, g_asObjectType, g_asObjectViewFrame, g_bExpandedShipGraphicsEnabled, get_right_shape(), IdentityWord(), initialize_view_buffer(), MaxShort(), MinShort(), negate_vector(), NormalizeFixedVector(), OBJECT_CLASS_BASE, OBJECT_CLASS_CAPITAL_SHIP, OBJECT_CLASS_MISSILE, OBJECT_CLASS_SHIP, SphericalVector::pitch, Viewport::pixels, rectangular_to_spherical(), ObjectTypeData::resourceType, rotate_about_i(), rotate_about_j(), transform_to_objects_frame(), FixedVector::x, FixedVector::y, SphericalVector::yaw, and FixedVector::z.
Referenced by get_right_shape(), and transform_objects_to_your_view().
| short get_ship_max_velocity | ( | short | obj | ) |
Definition at line 9 of file geom.c.
References g_acObjectType, g_aeObjectClass, g_aObjectTypeData, g_asPilotLevel, g_asShipSide, get_ship_max_velocity(), GetAdaptiveTurnRate(), ObjectTypeData::maximumVelocity, MaxShort(), MinShort(), OBJECT_CLASS_SHIP, RATING_ACE_SPIRIT, and SIDE_KILRATHI.
Referenced by FF_missile_intelligence(), fire_afterburner(), fire_weapon(), get_ship_max_velocity(), heat_seeking_missile_intelligence(), object_intelligence(), and recalc_max_velocity().
| short get_ship_slot | ( | void | ) |
Definition at line 829 of file geom.c.
References g_aeObjectClass, get_ship_slot(), and OBJECT_CLASS_NULL.
Referenced by fire_weapon(), get_ship_slot(), and initialize_ship().
| int GetShipAccelerationRate | ( | short | ship | ) |
Definition at line 62 of file geom.c.
References ObjectTypeData::acceleration, DivideFixed(), g_acObjectType, g_aeObjectClass, g_aObjectTypeData, g_asPilotLevel, g_asShipSide, GetAdaptiveTurnRate(), GetShipAccelerationRate(), MaxShort(), MinShort(), MultiplyFixed(), OBJECT_CLASS_SHIP, RATING_ACE_SPIRIT, and SIDE_KILRATHI.
Referenced by accelerate_and_move_object(), approach_speed(), control_speed(), and GetShipAccelerationRate().
| void init_ijk | ( | short | obj | ) |
Definition at line 453 of file geom.c.
References g_anObjectPitchRotation, g_anObjectRollRotation, g_anObjectYawRotation, g_aShipForwardVector, g_aShipRightVector, g_aShipUpVector, init_ijk(), FixedVector::x, FixedVector::y, and FixedVector::z.
Referenced by ApplyAlternateShipType(), init_ijk(), InitializeConstellationObject(), set_background_objects_rotation(), and set_objects_data().
| short IsPairEqualityDifferentFromFlag | ( | const unsigned int * | values | ) |
Definition at line 191 of file geom.c.
References IsPairEqualityDifferentFromFlag().
Referenced by IsPairEqualityDifferentFromFlag().
| short IsPointWithinRange | ( | FixedVector * | from, |
| FixedVector * | to, | ||
| short | range ) |
Definition at line 760 of file geom.c.
References ComputeVectorDelta(), IsPointWithinRange(), and IsVectorWithinRange().
Referenced by IsPointWithinRange(), kilrathi_near(), near_field(), ok_hazard_spot(), try_far_spot(), and within_field().
| void look_at | ( | short | obj | ) |
Definition at line 95 of file geom.c.
References EYE_OBJECT, g_aShipPosition, look_at(), and point_at().
Referenced by look_at(), new_view(), and set_eye_direction_and_position().
| void MakeRandomVectorFixed | ( | short | minimum, |
| short | maximum, | ||
| FixedVector * | vector ) |
Definition at line 264 of file geom.c.
References ChooseRandomSignedMagnitude(), MakeRandomVectorFixed(), FixedVector::x, FixedVector::y, and FixedVector::z.
Referenced by FillFixedVectorWithRandomComponents(), MakeRandomVectorFixed(), and onboard_explosion().
| short match_roll_orientation | ( | short | obj, |
| short | reference ) |
Definition at line 604 of file geom.c.
References ArcCos(), dot_product(), g_aShipRightVector, g_aShipUpVector, match_roll_orientation(), NormalizeFixedVector(), WrapDegrees(), FixedVector::x, FixedVector::y, and FixedVector::z.
Referenced by chase_location(), goto_formation(), match_roll_orientation(), and set_eye_direction_and_position().
| int MaxInt | ( | int | a, |
| int | b ) |
Definition at line 142 of file geom.c.
References MaxInt().
Referenced by MaxInt(), and object_collision().
| int MinInt | ( | int | a, |
| int | b ) |
Definition at line 133 of file geom.c.
References MinInt().
Referenced by accelerate_and_move_object(), MinInt(), and object_collision().
| void negate_vector | ( | FixedVector * | vector | ) |
Definition at line 203 of file geom.c.
References negate_vector(), FixedVector::x, FixedVector::y, and FixedVector::z.
Referenced by get_facing_range_from_object(), get_right_shape(), negate_vector(), object_collision(), set_background_objects_rotation(), set_eye_direction_and_position(), skew_randomly(), UpdateShipTurretGuns(), and UpdateTargetCameraObject().
| void NormalizeAndScaleVector | ( | FixedVector * | vector, |
| int | scale ) |
Definition at line 747 of file geom.c.
References NormalizeAndScaleVector(), NormalizeFixedVector(), and ScaleFixedVector().
Referenced by accelerate_and_move_object(), NormalizeAndScaleVector(), set_eye_direction_and_position(), SetVectorFixedPoint(), and UpdateTargetCameraObject().
| short NormalizeFixedVector | ( | FixedVector * | vector | ) |
Definition at line 347 of file geom.c.
References DivideFixed(), NormalizeFixedVector(), Vector_magnitude(), FixedVector::x, FixedVector::y, and FixedVector::z.
Referenced by auto_pilot_sequence(), capital_ship_strike_mission(), explosion_shock_wave(), facing_to_object(), FireTargetCameraGuns(), fix_objects_ijk(), get_facing_range_from_point(), get_right_shape(), launch_object(), match_roll_orientation(), new_view(), NormalizeAndScaleVector(), NormalizeFixedVector(), object_collision(), position_relative(), set_background_objects_rotation(), set_eye_direction_and_position(), sound_effect(), SpawnCapitalFlakProjectile(), UpdateShipTurretGuns(), vector_angle(), and vector_length_in_dir().
| void point_at | ( | short | obj, |
| FixedVector | point ) |
Definition at line 84 of file geom.c.
References ComputeVectorDelta(), fix_objects_ijk(), g_aShipForwardVector, g_aShipPosition, point_at(), and shrink_vector().
Referenced by approach(), auto_pilot_sequence(), fire_weapon(), FireTargetCameraGuns(), init_hazard(), look_at(), point_at(), SetFleetOverviewView(), and UpdateShipTurretGuns().
| void point_capital_ship_at_object | ( | short | obj, |
| short | other ) |
Definition at line 692 of file geom.c.
References ComputeVectorDelta(), g_aShipPosition, point_capital_ship_at_object(), and point_ship().
Referenced by capital_ship_strike_mission(), point_capital_ship_at_object(), and tanker_intelligence().
| void point_parallel | ( | short | obj, |
| short | other ) |
Definition at line 740 of file geom.c.
References g_aShipForwardVector, point_parallel(), and point_ship().
Referenced by escort_buddy(), goto_formation(), point_parallel(), and return_to_buddy().
| void point_perpendicular | ( | short | obj, |
| short | other ) |
Definition at line 734 of file geom.c.
References g_aShipPosition, point_perpendicular(), and point_perpendicular_to_point().
Referenced by defend_mission(), Mturn_n_kick(), point_perpendicular(), and return_to_master().
| void point_perpendicular_to_point | ( | short | obj, |
| const FixedVector * | point ) |
Definition at line 702 of file geom.c.
References g_anYawGoal, point_perpendicular_to_point(), and point_ship_at_point().
Referenced by orbit_sphere(), point_perpendicular(), and point_perpendicular_to_point().
| void point_ship | ( | short | obj, |
| short | turnRate, | ||
| const FixedVector * | direction ) |
Definition at line 667 of file geom.c.
References g_anPitchGoal, g_anYawGoal, point_ship(), and set_ship_rotation_goals().
Referenced by chase_location(), FF_missile_intelligence(), formation_burst(), goto_formation(), heat_seeking_missile_intelligence(), object_intelligence(), point_capital_ship_at_object(), point_parallel(), point_ship(), point_ship_at_point(), and run_away().
| void point_ship_at_object | ( | short | obj, |
| short | other ) |
Definition at line 686 of file geom.c.
References g_aShipPosition, point_ship_at_object(), and point_ship_at_point().
Referenced by capital_ship_strike_mission(), FF_missile_intelligence(), heat_seeking_missile_intelligence(), imperial_formation(), Mkill_missile(), Mram_missile(), Msit_n_fire(), Msit_n_spin(), Mstrafe_enemy(), Msuicide_run(), Mtail_fire(), Mtarget_missile(), Mturn_n_spin(), patrol_area(), point_ship_at_object(), rendezvous_mission(), return_to_buddy(), ShipAiState45(), streak_toward(), UpdateSavedTorpedoTargetLock(), and UpdateTargetCameraObject().
| void point_ship_at_point | ( | short | obj, |
| const FixedVector * | point ) |
Definition at line 676 of file geom.c.
References ComputeVectorDelta(), g_aShipPosition, point_ship(), and point_ship_at_point().
Referenced by cruise_home(), cruise_to_destination(), goto_location(), Mline_up_drop(), Msit_n_spin(), Mtry2tail(), orbit_sphere(), patrol_area(), point_perpendicular_to_point(), point_ship_at_object(), point_ship_at_point(), point_ship_behind_object(), and point_ship_below_object().
| void point_ship_behind_object | ( | short | obj, |
| short | other ) |
Definition at line 712 of file geom.c.
References g_aShipForwardVector, g_aShipPosition, g_asObjectCollisionRadius, point_ship_at_point(), point_ship_behind_object(), and position_relative().
Referenced by coming_home(), Mzip_past(), and point_ship_behind_object().
| void point_ship_below_object | ( | short | obj, |
| short | other ) |
Definition at line 723 of file geom.c.
References g_aShipPosition, g_aShipUpVector, g_asObjectCollisionRadius, point_ship_at_point(), point_ship_below_object(), and position_relative().
Referenced by Mzip_past(), and point_ship_below_object().
| void position_child | ( | short | parent, |
| short | weapon, | ||
| FixedVector * | position ) |
Definition at line 801 of file geom.c.
References g_aShipForwardVector, g_aShipPosition, g_aShipRightVector, g_aShipUpVector, g_aShipWeapons, position_child(), FixedVector::x, ShortVector::x, FixedVector::y, ShortVector::y, FixedVector::z, and ShortVector::z.
Referenced by child_object(), fire_turrets(), and position_child().
| void position_relative | ( | FixedVector * | position, |
| FixedVector | direction, | ||
| short | distance ) |
Definition at line 101 of file geom.c.
References AddFixedVectors(), NormalizeFixedVector(), position_relative(), and ScaleFixedVector().
Referenced by launch_carrier_fighter(), Mtry2tail(), offset_location(), point_ship_behind_object(), point_ship_below_object(), position_relative(), and position_relative_ijk().
| void position_relative_ijk | ( | FixedVector * | position, |
| short | obj, | ||
| short | right, | ||
| short | up, | ||
| short | forward ) |
Definition at line 112 of file geom.c.
References g_aShipForwardVector, g_aShipPosition, g_aShipRightVector, g_aShipUpVector, position_relative(), and position_relative_ijk().
Referenced by auto_position(), new_view(), position_relative_ijk(), SetFleetOverviewView(), and try_far_spot().
| void random_radial | ( | const FixedVector * | center, |
| short | radius, | ||
| FixedVector * | position ) |
Definition at line 278 of file geom.c.
References AddFixedVectors(), FillFixedVectorWithRandomComponents(), random_radial(), and RandomBelowOrEqual().
Referenced by place_ship_near_player_until_valid(), and random_radial().
| void recalc_max_velocity | ( | short | ship | ) |
Definition at line 28 of file geom.c.
References celerate(), g_acShipIonDriveDamage, g_anShipFuel, g_asShipMaximumVelocity, get_ship_max_velocity(), and recalc_max_velocity().
Referenced by ApplyAlternateShipType(), BeginShipCloak(), damage_ion_drive(), drain_fuel(), recalc_max_velocity(), set_objects_data(), and Set_up_ship_info().
| void rectangular_to_spherical | ( | const FixedVector * | rectangular, |
| SphericalVector * | spherical ) |
Definition at line 289 of file geom.c.
References ArcCos(), DivideFixed(), SphericalVector::pitch, PlanarMagnitude(), SphericalVector::radius, rectangular_to_spherical(), Vector_magnitude(), FixedVector::x, FixedVector::y, SphericalVector::yaw, and FixedVector::z.
Referenced by draw_3d_scanner(), get_right_shape(), object_collision(), rectangular_to_spherical(), set_background_objects_rotation(), set_objective_range(), and set_ship_rotation_goals().
| void remove_object | ( | short | obj | ) |
Definition at line 858 of file geom.c.
References clear_alert(), FreePacketAndClear(), g_abHazardObjects, g_acShipPendingMessage, g_acShipPortrait, g_aeObjectClass, g_apObjectShape, g_asLoadedShipViewFrame, g_asObjectDistance, g_asObjectScreenX, g_asObjectType, g_asShipIntelResourceKey, g_asShipIntelSlot, g_asShipManeuver, g_asShipSide, g_nNavPointerObject, g_nYourWingman, MANEUVER_NONE, OBJECT_CLASS_CAPITAL_SHIP, OBJECT_CLASS_NULL, OBJECT_CLASS_SHIP, remove_object(), and SIDE_NEUTRAL.
Referenced by animate_shape(), ApplyCannedSceneObjectEventRecord(), auto_pilot_sequence(), ClearTargetCameraView(), ClearTransientObjectsForEjection(), coming_home(), Create_explosion_debris(), cruise_home(), death_sequence(), ejection_sequence(), free_ship(), FreeConstellationObject(), house_keep_objects(), object_collision(), remove_all_3d_objects(), remove_hazard(), remove_nav_point_objects(), remove_nav_pointer(), remove_object(), run_away(), set_up_action_sphere(), set_up_next_wave(), and UpdateTargetCameraObject().
| void rotate_about_i | ( | short | angle, |
| FixedVector * | j, | ||
| FixedVector * | k ) |
Definition at line 393 of file geom.c.
References CosFixed(), MultiplyFixed(), rotate_about_i(), SinFixed(), FixedVector::x, FixedVector::y, and FixedVector::z.
Referenced by alter_pitch(), generate_stars(), get_right_shape(), initialize_direction_view_frame(), rotate_about_i(), set_eye_direction_and_position(), try_far_spot(), update_star_field(), and UpdateFleetOverviewCameraRotation().
| void rotate_about_j | ( | short | angle, |
| FixedVector * | i, | ||
| FixedVector * | k ) |
Definition at line 413 of file geom.c.
References CosFixed(), MultiplyFixed(), rotate_about_j(), SinFixed(), FixedVector::x, FixedVector::y, and FixedVector::z.
Referenced by alter_yaw(), generate_stars(), get_right_shape(), initialize_direction_view_frame(), rotate_about_j(), set_eye_direction_and_position(), try_far_spot(), update_star_field(), and UpdateFleetOverviewCameraRotation().
| void rotate_about_k | ( | short | angle, |
| FixedVector * | i, | ||
| FixedVector * | j ) |
Definition at line 433 of file geom.c.
References CosFixed(), MultiplyFixed(), rotate_about_k(), SinFixed(), FixedVector::x, FixedVector::y, and FixedVector::z.
Referenced by alter_roll(), and rotate_about_k().
| void rotational_acceleration | ( | FixedVector * | point, |
| FixedVector * | force, | ||
| short | obj ) |
Definition at line 965 of file geom.c.
References check_for_lost_control(), ClampTo30(), DivideFixed(), g_acObjectType, g_aeObjectClass, g_anObjectPitchRotation, g_anObjectRollRotation, g_anObjectYawRotation, g_aObjectTypeData, g_asObjectCollisionRadius, MultiplyFixed(), OBJECT_CLASS_SHIP, rotational_acceleration(), transform_to_objects_frame(), FixedVector::x, FixedVector::y, and FixedVector::z.
Referenced by object_collision(), and rotational_acceleration().
| void ScaleFixedVector | ( | FixedVector * | vector, |
| int | scale, | ||
| FixedVector * | result ) |
Definition at line 237 of file geom.c.
References MultiplyFixed(), ScaleFixedVector(), FixedVector::x, FixedVector::y, and FixedVector::z.
Referenced by accelerate_and_move_object(), animate_object(), approach(), auto_pilot_sequence(), capital_ship_strike_mission(), chase_location(), ComputePointAheadOfObject(), ComputePointBehindObject(), explosion_shock_wave(), fire_weapon(), FireTargetCameraGuns(), fix_velocity(), generate_stars(), init_formation_burst(), init_hazard(), InitializeConstellationObject(), launch_carrier_fighter(), launch_object(), match_ship_to_eye(), Msit_n_spin(), new_view(), NormalizeAndScaleVector(), object_collision(), position_relative(), real_crash_time(), ScaleFixedVector(), servicetrack(), set_eye_direction_and_position(), SetFleetOverviewView(), SpawnCapitalFlakProjectile(), SpawnFlakBurst(), start_dust(), steer_away_from_predicted_object(), update_star_field(), UpdateShipTurretGuns(), UpdateTargetCameraObject(), UpdateTargetLeadIndicator(), and vector_component_in_dir().
| void set_background_objects_rotation | ( | short | obj, |
| FixedVector * | direction ) |
Definition at line 1152 of file geom.c.
References alter_pitch(), alter_yaw(), ArcCos(), dot_product(), EYE_OBJECT, g_aShipRightVector, g_aShipUpVector, g_asObjectScreenAngle, g_asObjectScreenScale, init_ijk(), negate_vector(), NormalizeFixedVector(), SphericalVector::pitch, rectangular_to_spherical(), SCRATCH_VIEW_OBJECT, set_background_objects_rotation(), FixedVector::x, FixedVector::y, SphericalVector::yaw, and FixedVector::z.
Referenced by set_background_objects_rotation(), and transform_objects_to_your_view().
| short set_ship_rotation_goals | ( | short | obj, |
| short | turnRate, | ||
| const FixedVector * | direction, | ||
| short | pointingMode, | ||
| short * | yawGoal, | ||
| short * | pitchGoal ) |
Definition at line 622 of file geom.c.
References ArcSin(), DivideFixed(), SphericalVector::pitch, PlanarMagnitude(), SphericalVector::radius, rectangular_to_spherical(), set_ship_rotation_goals(), transform_to_objects_frame(), Vector_magnitude(), WrapDegrees(), FixedVector::x, FixedVector::y, SphericalVector::yaw, and FixedVector::z.
Referenced by point_ship(), and set_ship_rotation_goals().
| void SetVectorFixedPoint | ( | unsigned int * | p, |
| short | v ) |
Definition at line 754 of file geom.c.
References NormalizeAndScaleVector(), and SetVectorFixedPoint().
Referenced by make_shard(), send_at_point(), set_eye_direction_and_position(), and SetVectorFixedPoint().
| unsigned int SignFixed | ( | int | v | ) |
Definition at line 160 of file geom.c.
References SignFixed().
Referenced by approach_speed(), and SignFixed().
| void SubtractFixedVectors | ( | FixedVector * | left, |
| FixedVector * | right, | ||
| FixedVector * | difference ) |
Definition at line 220 of file geom.c.
References SubtractFixedVectors(), FixedVector::x, FixedVector::y, and FixedVector::z.
Referenced by auto_pilot_sequence(), fire_weapon(), init_hazard(), object_collision(), and SubtractFixedVectors().
Definition at line 1022 of file geom.c.
References ComputeVectorDelta(), DivideFixed(), draw_nav_pointer(), EYE_OBJECT, g_aeObjectClass, g_anCloakVisibilityPattern, g_anShipCloakState, g_aShipPosition, g_asObjectCollisionRadius, g_asObjectCounter, g_asObjectDistance, g_asObjectScale, g_asObjectScreenAngle, g_asObjectScreenScale, g_asObjectScreenX, g_asObjectScreenY, g_asObjectType, g_asObjectViewFrame, g_asShipCloakElapsedFrames, g_nNavPointerObject, g_nScreenWidth, g_nSpaceFrame, get_right_shape(), MaxShort(), MinShort(), MultiplyFixed(), OBJECT_CLASS_ASTEROID, OBJECT_CLASS_CAPITAL_SHIP, OBJECT_CLASS_DEBRIS, OBJECT_CLASS_DUST, OBJECT_CLASS_EXPLOSION, OBJECT_CLASS_FIXED_OBJECT, OBJECT_CLASS_FUTURION, OBJECT_CLASS_MISSILE, OBJECT_CLASS_NULL, OBJECT_CLASS_PLANET, OBJECT_CLASS_PROJECTILE, OBJECT_CLASS_SHIP, OBJECT_CLASS_STAR, set_background_objects_rotation(), SPACE_LAST_MOVING_OBJECT, transform_objects_to_your_view(), transform_to_objects_frame(), Vector_magnitude(), FixedVector::x, FixedVector::y, and FixedVector::z.
Referenced by DrawSpaceSceneFrame(), and transform_objects_to_your_view().
| void transform_to_objects_frame | ( | const FixedVector * | source, |
| FixedVector * | destination, | ||
| short | obj ) |
Definition at line 495 of file geom.c.
References dot_product(), g_aShipForwardVector, g_aShipRightVector, g_aShipUpVector, transform_to_objects_frame(), FixedVector::x, FixedVector::y, and FixedVector::z.
Referenced by apply_force_to_object(), draw_3d_scanner(), draw_nav_pointer(), get_right_shape(), object_collision(), rotational_acceleration(), set_objective_range(), set_ship_rotation_goals(), steer_away_from_object(), steer_away_from_predicted_object(), transform_objects_to_your_view(), transform_to_objects_frame(), update_star_field(), and UpdateTargetLeadIndicator().
| short vector_angle | ( | FixedVector | left, |
| FixedVector | right ) |
Definition at line 324 of file geom.c.
References dot_product(), NormalizeFixedVector(), and vector_angle().
Referenced by hemisphere(), and vector_angle().
| void vector_component_in_dir | ( | const FixedVector * | vector, |
| const FixedVector * | direction, | ||
| FixedVector * | component ) |
Definition at line 375 of file geom.c.
References ScaleFixedVector(), vector_component_in_dir(), and vector_length_in_dir().
Referenced by fire_weapon(), house_keep_objects(), launch_object(), object_collision(), UpdateTargetLeadIndicator(), and vector_component_in_dir().
| void vector_cross_product | ( | const FixedVector * | left, |
| const FixedVector * | right, | ||
| FixedVector * | product ) |
Definition at line 335 of file geom.c.
References MultiplyFixed(), vector_cross_product(), FixedVector::x, FixedVector::y, and FixedVector::z.
Referenced by fix_objects_ijk(), and vector_cross_product().
| int vector_length_in_dir | ( | const FixedVector * | vector, |
| const FixedVector * | direction ) |
Definition at line 361 of file geom.c.
References dot_product(), MultiplyFixed(), NormalizeFixedVector(), vector_length_in_dir(), and Vector_magnitude().
Referenced by vector_component_in_dir(), and vector_length_in_dir().
| short WrapDegrees | ( | short | degrees | ) |
Definition at line 171 of file geom.c.
References WrapDegrees().
Referenced by match_roll_orientation(), set_ship_rotation_goals(), and WrapDegrees().
| void zero_vector | ( | FixedVector * | vector | ) |
Definition at line 197 of file geom.c.
References FixedVector::x, FixedVector::y, FixedVector::z, and zero_vector().
Referenced by accelerate_and_move_object(), animate_object(), auto_pilot_sequence(), capital_ship_strike_mission(), ClearTargetCameraView(), cruise_home(), find_squad_center(), FireTargetCameraGuns(), initialize_object(), locate_ship(), new_view(), object_collision(), run_away(), set_eye_direction_and_position(), Set_up_ship_info(), SetFleetOverviewView(), SpawnCapitalFlakProjectile(), SpawnFlakBurst(), SpawnMissionEjectionPod(), UpdateShipTurretGuns(), UpdateTargetCameraObject(), UpdateTargetCameraTracking(), UpdateTargetLeadIndicator(), and zero_vector().
| FixedVector g_2_vNormalizedToTgt |
Definition at line 1332 of file geom.c.
Referenced by get_facing_range_from_object(), get_facing_range_from_point(), and UpdateShipTurretGuns().
| int g_abObjectShapeOwned[SPACE_OBJECT_COUNT] = { 0 } |
Definition at line 559 of file geom.c.
Referenced by get_right_shape().
| int g_anCloakVisibilityPattern[20] |
Definition at line 555 of file geom.c.
Referenced by show_target_disp(), and transform_objects_to_your_view().
| int g_nFacingRangeQueryCount = 0 |
Definition at line 554 of file geom.c.
Referenced by get_facing_range_from_point().