|
Wing Commander
Reconstructed Win32 source (1996)
|
Vector, angle and fixed-point geometry, and ship speed and fuel limits. More...
#include "wc1.h"Go to the source code of this file.
Functions | |
| short __stdcall | MeasureTextPixelWidthClamped (const char *text) |
| int __stdcall | SeekPacketSection (PacketSectionHandle *handle, int offset, short origin) |
| unsigned short | GetMusicDriverPresent (short mode) |
| short __stdcall | CollectActivePaletteIndices (Viewport *viewport, unsigned char *indices, short capacity) |
| short | get_ship_max_velocity (short obj) |
| short | recalc_max_velocity (short ship) |
| void | drain_fuel (short ship, short amount) |
| void | damage_ion_drive (short ship, short amount, short maximum) |
| int | GetShipAccelerationRate (short ship) |
| void | point_at (short obj, FixedVector point) |
| void | look_at (short obj) |
| void | position_relative (FixedVector *position, FixedVector direction, short distance) |
| void | position_relative_ijk (FixedVector *position, short obj, short right, short up, short forward) |
| short | FixedToShortSaturating (int value) |
| int | MinInt (int a, int b) |
| int | MaxInt (int a, int b) |
| int | AbsInt (int v) |
| int | intfract_sign (int sign, int magnitude) |
| unsigned short | SignShort (short v) |
| unsigned int | SignFixed (int v) |
| short | WrapDegrees (short degrees) |
| int | equ_vector (const FixedVector *left, const FixedVector *right) |
| int | IsPairEqualityDifferentFromFlag (const unsigned int *values) |
| void | zero_vector (FixedVector *vector) |
| void | negate_vector (FixedVector *vector) |
| void | AddFixedVectors (const FixedVector *left, const FixedVector *right, FixedVector *sum) |
| void | SubtractFixedVectors (FixedVector *left, FixedVector *right, FixedVector *difference) |
| void | ComputeVectorDelta (const FixedVector *from, const FixedVector *to, FixedVector *delta) |
| void | ScaleFixedVector (const FixedVector *vector, int scale, FixedVector *result) |
| void | divide_vector (FixedVector *vector, int divisor, FixedVector *result) |
| short | ChooseRandomSignedMagnitude (short minimum, short maximum, int allowNegative) |
| void | MakeRandomVectorFixed (short minimum, short maximum, FixedVector *vector) |
| void | FillFixedVectorWithRandomComponents (short limit, FixedVector *vector) |
| void | random_radial (const FixedVector *center, short radius, FixedVector *position) |
| void | MakeRandomNormalizedVector (FixedVector *vector) |
| void | rectangular_to_spherical (const FixedVector *rectangular, SphericalVector *spherical) |
| long | SinFixed (short degrees) |
| void | ConvertSphericalToRectangular (const SphericalVector *spherical, FixedVector *rectangular) |
| void | ConvertShortVectorToFixedVector (const ShortVector *source, FixedVector *destination) |
| void | ConvertFixedVectorToShortVector (const FixedVector *source, ShortVector *destination) |
| int | dot_product (const FixedVector *left, const FixedVector *right) |
| short | vector_angle (FixedVector left, FixedVector right) |
| void | vector_cross_product (const FixedVector *left, const FixedVector *right, FixedVector *product) |
| short | NormalizeFixedVector (FixedVector *vector) |
| int | vector_length_in_dir (const FixedVector *vector, const FixedVector *direction) |
| void | vector_component_in_dir (const FixedVector *vector, const FixedVector *direction, FixedVector *component) |
| void | rotate_about_i (short angle, FixedVector *j, FixedVector *k) |
| void | rotate_about_j (short angle, FixedVector *i, FixedVector *k) |
| void | rotate_about_k (short angle, FixedVector *i, FixedVector *j) |
| void | init_ijk (short obj) |
| void | copy_frame (short source, short destination) |
| void | fix_objects_ijk (short obj) |
| void | transform_to_objects_frame (const FixedVector *source, FixedVector *destination, short obj) |
| void | alter_pitch (short angle, short obj) |
| void | alter_yaw (short angle, short obj) |
| void | alter_roll (short angle, short obj) |
| short | distance_between_points (const FixedVector *from, const FixedVector *to) |
| short | distance_from_point (short obj, const FixedVector *point) |
| short | distance_from_object (short obj, short other) |
| void | get_facing_range_from_point (short obj, const FixedVector *point) |
| void | get_facing_range_from_object (short obj, short other) |
| void | ship_vs_point (short obj, const FixedVector *point) |
| void | ship_vs_ship (short obj, short other) |
| short | facing_to_object (short obj, FixedVector *point) |
| short | match_roll_orientation (short obj, short reference) |
| int | set_ship_rotation_goals (short obj, short turnRate, const FixedVector *direction, short pointingMode, short *yawGoal, short *pitchGoal) |
| void | point_ship (short obj, short turnRate, const FixedVector *direction) |
| void | point_ship_at_point (short obj, const FixedVector *point) |
| void | point_ship_at_object (short obj, short other) |
| void | point_capital_ship_at_object (short obj, short other) |
| void | point_ship_behind_object (short obj, short other) |
| void | point_ship_below_object (short obj, short other) |
| void | point_perpendicular_to_point (short obj, const FixedVector *point) |
| void | point_perpendicular (short obj, short other) |
| void | point_parallel (short obj, short other) |
| void | MoveObjectAlongDirection (short obj, const FixedVector *direction, short distance) |
| void | ComputeObjectToPointDelta (short obj, FixedVector *point, FixedVector *delta) |
| void | ComputeObjectToObjectDelta (short obj, short other, FixedVector *delta) |
| void | NormalizeAndScaleVector (FixedVector *vector, int scale) |
| void | SetVectorFixedPoint (FixedVector *p, short v) |
| unsigned int | IsPointWithinRange (const FixedVector *from, const FixedVector *to, short range) |
| short | check_for_collision (short obj) |
| void | position_child (short parent, short hardpoint, FixedVector *position) |
| void | child_object (short hardpoint, short child, short parent) |
| short | get_ship_slot (void) |
| short | find_vacant_3d_object (void) |
| void | remove_object (short obj) |
| void | apply_force_to_objects_center (FixedVector *force, short obj) |
| void | apply_force_to_object (FixedVector *point, FixedVector *force, short obj) |
| void | rotational_acceleration (FixedVector *point, FixedVector *force, short obj) |
| void | ClampVectorTo30 (short *p) |
| void | ClampTo30 (short *p) |
| unsigned short | IsPointWithinEyeViewCone (const FixedVector *point) |
| void | transform_objects_to_your_view (void) |
| void | set_background_objects_rotation (short obj, FixedVector *direction) |
| void | get_right_shape (short obj, FixedVector *direction) |
Variables | |
| signed char | cCapitalShipLogicalFile |
| FixedVector | vNormalizedToTarget |
Vector, angle and fixed-point geometry, and ship speed and fuel limits.
Address range 418080-41a9cf. Text, packet, music and palette helpers open the range and get_right_shape closes it; the modal-panel block at 41a9d0 belongs with the barracks data and save/load routines.
Definition in file geom.c.
| int AbsInt | ( | int | v | ) |
Definition at line 217 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 296 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(), chase_location(), compute_formation_destination(), Create_explosion_debris(), Create_ship_hit_debris(), DrawNavHazardMarker(), ejection_sequence(), find_squad_center(), fire(), fire_weapon(), get_front_spot(), get_rear_spot(), goto_formation(), init_formation_burst(), init_hazard(), init_ship(), launch_object(), locate_ship(), make_shard(), MoveObjectAlongDirection(), Msit_n_spin(), new_view(), object_collision(), onboard_explosion(), parse_view_script(), pop_flack(), position_relative(), random_radial(), real_crash_time(), servicetrack(), set_eye_direction_and_position(), set_sphere_point(), SetFleetOverviewView(), ShowCarrierLaunchSequence(), ShowGameOverScreen(), ShowTigerClawEscapeScene(), start_dust(), steer_away_from_object(), steer_away_from_predicted_object(), and update_star_field().
| void alter_pitch | ( | short | angle, |
| short | obj ) |
Definition at line 619 of file geom.c.
References alter_pitch(), aShipFwdVec, aShipUpVector, fix_objects_ijk(), and rotate_about_i().
Referenced by alter_pitch(), ejection_sequence(), InitializeConstellationObject(), make_shard(), parse_view_script(), rotate_object(), set_background_objects_rotation(), and Set_up_ship_info().
| void alter_roll | ( | short | angle, |
| short | obj ) |
Definition at line 635 of file geom.c.
References alter_roll(), aShipRightVector, aShipUpVector, fix_objects_ijk(), and rotate_about_k().
Referenced by alter_roll(), InitializeConstellationObject(), parse_view_script(), rotate_object(), and Set_up_ship_info().
| void alter_yaw | ( | short | angle, |
| short | obj ) |
Definition at line 627 of file geom.c.
References alter_yaw(), aShipFwdVec, aShipRightVector, fix_objects_ijk(), and rotate_about_j().
Referenced by alter_yaw(), CreateCannedSceneObject(), InitializeConstellationObject(), make_shard(), parse_view_script(), rotate_object(), set_background_objects_rotation(), Set_up_ship_info(), and ShowCarrierLaunchSequence().
| void apply_force_to_object | ( | FixedVector * | point, |
| FixedVector * | force, | ||
| short | obj ) |
Definition at line 1045 of file geom.c.
References AddFixedVectors(), aeObjectClass, anObjectRollRotationList, anObjectYawRotation, anObjPitchRot, apply_force_to_object(), aShipVelocity, asObjAfterburnerVelocities, asObjectCollisionRadius, awObjMassArray, check_for_lost_control(), ClampTo30(), DivideFixed(), MultiplyFixed(), OBJECT_CLASS_SHIP, PlanarMagnitude(), 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 1035 of file geom.c.
References AddFixedVectors(), apply_force_to_objects_center(), aShipVelocity, awObjMassArray, and divide_vector().
Referenced by apply_force_to_objects_center(), and explosion_shock_wave().
| short check_for_collision | ( | short | obj | ) |
Definition at line 922 of file geom.c.
References aeObjectClass, aShipPositionsArray, asObjectCollisionRadius, check_for_collision(), ComputeVectorDelta(), IsVectorWithinRange(), OBJECT_CLASS_PROJECTILE, OBJECT_CLASS_SHIP, SPACE_LAST_MOVING_OBJECT, and vCollisionDelta.
Referenced by check_for_collision(), and object_collision().
| void child_object | ( | short | hardpoint, |
| short | child, | ||
| short | parent ) |
Definition at line 969 of file geom.c.
References acObjOwnersTable, aShipPositionsArray, child_object(), and position_child().
Referenced by child_object(), drop_mine(), and fire_weapon().
| short ChooseRandomSignedMagnitude | ( | short | minimum, |
| short | maximum, | ||
| int | allowNegative ) |
Definition at line 338 of file geom.c.
References ChooseRandomSignedMagnitude(), and RandomInRange().
Referenced by ChooseRandomSignedMagnitude(), and MakeRandomVectorFixed().
| void ClampTo30 | ( | short * | p | ) |
Definition at line 1150 of file geom.c.
References ClampTo30().
Referenced by apply_force_to_object(), ClampTo30(), and rotational_acceleration().
| void ClampVectorTo30 | ( | short * | p | ) |
Definition at line 1137 of file geom.c.
References ClampVectorTo30().
Referenced by ClampVectorTo30(), and rotate_object().
| short __stdcall CollectActivePaletteIndices | ( | Viewport * | viewport, |
| unsigned char * | indices, | ||
| short | capacity ) |
Definition at line 71 of file geom.c.
References AllocateTaggedMemory(), CollectActivePaletteIndices(), MarkActivePaletteEntries(), and ReleasePacketHandle().
Referenced by CollectActivePaletteIndices(), FadeViewportPaletteToColour(), and PanToScreen().
| void ComputeObjectToObjectDelta | ( | short | obj, |
| short | other, | ||
| FixedVector * | delta ) |
Definition at line 894 of file geom.c.
References aShipPositionsArray, ComputeObjectToObjectDelta(), and ComputeVectorDelta().
Referenced by ComputeObjectToObjectDelta().
| void ComputeObjectToPointDelta | ( | short | obj, |
| FixedVector * | point, | ||
| FixedVector * | delta ) |
Definition at line 886 of file geom.c.
References aShipPositionsArray, ComputeObjectToPointDelta(), and ComputeVectorDelta().
Referenced by ComputeObjectToPointDelta().
| void ComputeVectorDelta | ( | const FixedVector * | from, |
| const FixedVector * | to, | ||
| FixedVector * | delta ) |
Definition at line 314 of file geom.c.
References ComputeVectorDelta(), FixedVector::x, FixedVector::y, and FixedVector::z.
Referenced by accelerate_and_move_object(), auto_pilot_sequence(), check_for_collision(), ComputeObjectToObjectDelta(), ComputeObjectToPointDelta(), ComputeVectorDelta(), distance_between_points(), distance_from_point(), draw_nav_pointer(), explosion_shock_wave(), facing_to_object(), fire(), fire_weapon(), GetShipDistanceToNavPoint(), hemisphere(), init_formation_burst(), IsPointWithinEyeViewCone(), IsPointWithinRange(), new_view(), object_collision(), parse_view_script(), PlaySfxWaveFileByNumber(), point_at(), point_capital_ship_at_object(), point_ship_at_point(), real_crash_time(), send_at_point(), servicetrack(), set_eye_direction_and_position(), set_objective_range(), SetFleetOverviewView(), ships_within_range(), steer_away_from_object(), steer_away_from_predicted_object(), transform_objects_to_your_view(), update_objective_location(), and update_star_field().
| void ConvertFixedVectorToShortVector | ( | const FixedVector * | source, |
| ShortVector * | destination ) |
Definition at line 432 of file geom.c.
References ConvertFixedVectorToShortVector(), FixedVector::x, ShortVector::x, FixedVector::y, ShortVector::y, FixedVector::z, and ShortVector::z.
Referenced by ConvertFixedVectorToShortVector().
| void ConvertShortVectorToFixedVector | ( | const ShortVector * | source, |
| FixedVector * | destination ) |
Definition at line 421 of file geom.c.
References ConvertShortVectorToFixedVector(), FixedVector::x, ShortVector::x, FixedVector::y, ShortVector::y, FixedVector::z, and ShortVector::z.
Referenced by ConvertShortVectorToFixedVector().
| void ConvertSphericalToRectangular | ( | const SphericalVector * | spherical, |
| FixedVector * | rectangular ) |
Definition at line 405 of file geom.c.
References ConvertSphericalToRectangular(), CosFixed(), MultiplyFixed(), SphericalVector::pitch, SphericalVector::radius, SinFixed(), FixedVector::x, FixedVector::y, SphericalVector::yaw, and FixedVector::z.
Referenced by ConvertSphericalToRectangular().
| void copy_frame | ( | short | source, |
| short | destination ) |
Definition at line 585 of file geom.c.
References aShipFwdVec, aShipRightVector, aShipUpVector, and copy_frame().
Referenced by auto_pilot_sequence(), chase_location(), copy_frame(), drop_mine(), ejection_sequence(), fire_weapon(), generate_stars(), goto_formation(), new_view(), parse_view_script(), RunSpaceFlight(), set_eye_direction_and_position(), set_formation_position(), ShipExplosion(), ShowCarrierLaunchSequence(), try_far_spot(), and update_star_field().
| void damage_ion_drive | ( | short | ship, |
| short | amount, | ||
| short | maximum ) |
Definition at line 132 of file geom.c.
References acShipIonDriveDmg, damage_ion_drive(), 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 643 of file geom.c.
References ComputeVectorDelta(), distance_between_points(), FixedToShortSaturating(), and Vector_magnitude().
Referenced by auto_pilot_sequence(), distance_between_points(), and init_hazard().
| short distance_from_object | ( | short | obj, |
| short | other ) |
Definition at line 667 of file geom.c.
References aShipPositionsArray, asObjectCollisionRadius, distance_from_object(), and distance_from_point().
Referenced by abandoned(), any_enemy(), approach_and_engage(), attacker_in_range(), auto_pilot_sequence(), build_target_list(), cleanup_objectives(), cruise_home(), defend_mission(), distance_from_object(), escort_mission(), FF_missile_intelligence(), imperial_formation(), in_danger(), mine_intelligence(), nearest_enemy_range(), rendezvous_mission(), report_kilrathi_rout(), return_to_buddy(), return_to_master(), run_away(), scan_for_enemy(), and select_target().
| short distance_from_point | ( | short | obj, |
| const FixedVector * | point ) |
Definition at line 655 of file geom.c.
References aShipPositionsArray, asObjectCollisionRadius, ComputeVectorDelta(), distance_from_point(), FixedToShortSaturating(), Vector_magnitude(), and vToTgt.
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(), and scan_for_enemy().
| void divide_vector | ( | FixedVector * | vector, |
| int | divisor, | ||
| FixedVector * | result ) |
Definition at line 330 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 441 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(), transform_to_objects_frame(), vector_angle(), and vector_length_in_dir().
| void drain_fuel | ( | short | ship, |
| short | amount ) |
Definition at line 124 of file geom.c.
References anShipFuelsTable, drain_fuel(), and recalc_max_velocity().
Referenced by accelerate_and_move_object(), drain_fuel(), housekeep_power_plant_and_fuel(), internal_damage(), and your_internal_damage().
| int equ_vector | ( | const FixedVector * | left, |
| const FixedVector * | right ) |
Definition at line 267 of file geom.c.
References equ_vector(), FixedVector::x, FixedVector::y, and FixedVector::z.
Referenced by auto_pilot_sequence(), cruise_home(), cruise_to_destination(), and equ_vector().
| short facing_to_object | ( | short | obj, |
| FixedVector * | point ) |
Definition at line 716 of file geom.c.
References aShipFwdVec, aShipPositionsArray, ComputeVectorDelta(), dot_product(), facing_to_object(), nFacingToTargetValue, and NormalizeFixedVector().
Referenced by facing_to_object(), and imperial_formation().
| void FillFixedVectorWithRandomComponents | ( | short | limit, |
| FixedVector * | vector ) |
Definition at line 357 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 987 of file geom.c.
References aeObjectClass, asObjectScreenXList, find_vacant_3d_object(), and OBJECT_CLASS_NULL.
Referenced by animate_object(), Create_explosion_debris(), Create_ship_hit_debris(), CreateCannedSceneObject(), draw_nav_pointer(), ejection_sequence(), find_vacant_3d_object(), init_constellation(), make_hazard(), make_shard(), new_object(), onboard_explosion(), place_exhaust_on_ships(), ShipExplosion(), ShowTigerClawEscapeScene(), unwarp(), and warp().
| void fix_objects_ijk | ( | short | obj | ) |
Definition at line 596 of file geom.c.
References aShipFwdVec, aShipRightVector, aShipUpVector, fix_objects_ijk(), NormalizeFixedVector(), and vector_cross_product().
Referenced by alter_pitch(), alter_roll(), alter_yaw(), fix_objects_ijk(), make_shard(), new_view(), parse_view_script(), point_at(), set_eye_direction_and_position(), and ShowGameOverScreen().
| short FixedToShortSaturating | ( | int | value | ) |
Definition at line 193 of file geom.c.
References FixedToShortSaturating().
Referenced by 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 691 of file geom.c.
References aShipFwdVec, aShipPositionsArray, asObjectCollisionRadius, dot_product(), get_facing_range_from_object(), get_facing_range_from_point(), negate_vector(), nTargetFacingValue, nTgtRange, and vNormalizedToTarget.
Referenced by cruise_to_destination(), FindEnemyAimingWithinRange(), fire(), get_facing_range_from_object(), heat_seeking_missile_intelligence(), house_keep_objects(), object_intelligence(), prepare_for_jump(), scan_for_enemy(), ship_vs_ship(), and target_locking().
| void get_facing_range_from_point | ( | short | obj, |
| const FixedVector * | point ) |
Definition at line 676 of file geom.c.
References aShipFwdVec, asObjectCollisionRadius, distance_from_point(), dot_product(), get_facing_range_from_point(), nFacingToTargetValue, NormalizeFixedVector(), nTgtRange, vNormalizedToTarget, and vToTgt.
Referenced by chase_location(), get_facing_range_from_object(), get_facing_range_from_point(), goto_formation(), and ship_vs_point().
| void get_right_shape | ( | short | obj, |
| FixedVector * | direction ) |
Definition at line 1341 of file geom.c.
References aapPacketReferences, acDirectionShapeFlip, acDirectionShapeFrame, aDirectionViewRightVector, aDirectionViewUpVectorArray, aeObjectClass, aeObjectTypeList, aObjectResourceSlotsArray, apObjShapeArray, ArcCos(), asCapitalShipViewFramesTable, aShipUpVector, asObjectFlipArray, asObjectViewFrames, asObjScreenAngles, cCapitalShipLogicalFile, DIRECTION_VIEW_COUNT, dot_product(), EYE_OBJECT, FetchDiskPacketRetrying(), get_right_shape(), GetScreenUpdateFlag(), IdentityWord(), initialize_view_buffer(), negate_vector(), NormalizeFixedVector(), OBJECT_CLASS_CAPITAL_SHIP, OBJECT_CLASS_MISSILE, OBJECT_TYPE_KILRATHI_BASE, OBJECT_TYPE_TURRET, SphericalVector::pitch, Viewport::pixels, rectangular_to_spherical(), rotate_about_i(), rotate_about_j(), stSpaceBufferViewport, 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 95 of file geom.c.
References acShipRating, aeObjectTypeList, aObjectTypeData, get_ship_max_velocity(), and ObjectTypeData::maximumVelocity.
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 976 of file geom.c.
References aeObjectClass, get_ship_slot(), nFreeShipSlot, and OBJECT_CLASS_NULL.
Referenced by get_ship_slot(), and initialize_ship().
| unsigned short GetMusicDriverPresent | ( | short | mode | ) |
Definition at line 65 of file geom.c.
References GetMusicDriverPresent().
Referenced by GetMusicDriverPresent(), and LoadOriginFxDrivers().
| int GetShipAccelerationRate | ( | short | ship | ) |
Definition at line 140 of file geom.c.
References ObjectTypeData::acceleration, acShipRating, aeObjectTypeList, aObjectTypeData, GetShipAccelerationRate(), and RATING_ACE_ICEMAN.
Referenced by accelerate_and_move_object(), approach_speed(), control_speed(), and GetShipAccelerationRate().
| void init_ijk | ( | short | obj | ) |
Definition at line 568 of file geom.c.
References anObjectRollRotationList, anObjectYawRotation, anObjPitchRot, aShipFwdVec, aShipRightVector, aShipUpVector, init_ijk(), FixedVector::x, FixedVector::y, and FixedVector::z.
Referenced by CreateCannedSceneObject(), init_ijk(), initialize_scripted_view(), InitializeConstellationObject(), set_background_objects_rotation(), and set_objects_data().
| int intfract_sign | ( | int | sign, |
| int | magnitude ) |
| int IsPairEqualityDifferentFromFlag | ( | const unsigned int * | values | ) |
Definition at line 274 of file geom.c.
References IsPairEqualityDifferentFromFlag().
Referenced by IsPairEqualityDifferentFromFlag().
| unsigned short IsPointWithinEyeViewCone | ( | const FixedVector * | point | ) |
Definition at line 1161 of file geom.c.
References aShipPositionsArray, asObjectCollisionRadius, ComputeVectorDelta(), DivideFixed(), EYE_OBJECT, IsPointWithinEyeViewCone(), transform_to_objects_frame(), Vector_magnitude(), and FixedVector::z.
Referenced by IsPointWithinEyeViewCone().
| unsigned int IsPointWithinRange | ( | const FixedVector * | from, |
| const FixedVector * | to, | ||
| short | range ) |
Definition at line 913 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 166 of file geom.c.
References aShipPositionsArray, EYE_OBJECT, look_at(), and point_at().
Referenced by look_at(), new_view(), and set_eye_direction_and_position().
| void MakeRandomNormalizedVector | ( | FixedVector * | vector | ) |
Definition at line 374 of file geom.c.
References MakeRandomNormalizedVector(), NormalizeFixedVector(), RandomInRange(), FixedVector::x, FixedVector::y, and FixedVector::z.
Referenced by MakeRandomNormalizedVector().
| void MakeRandomVectorFixed | ( | short | minimum, |
| short | maximum, | ||
| FixedVector * | vector ) |
Definition at line 349 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 730 of file geom.c.
References ArcCos(), aShipRightVector, aShipUpVector, dot_product(), 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 210 of file geom.c.
References MaxInt().
Referenced by MaxInt(), and object_collision().
| short __stdcall MeasureTextPixelWidthClamped | ( | const char * | text | ) |
Definition at line 18 of file geom.c.
References GetFontCharWidth(), and MeasureTextPixelWidthClamped().
Referenced by EraseLastTextInputCharacter(), InitializeDiskPromptTextContext(), MeasureTextPixelWidthClamped(), PromptForTextInput(), ReadTextInput(), ShowModalTextPanel(), and ShowTrainSimHighScores().
| int MinInt | ( | int | a, |
| int | b ) |
Definition at line 203 of file geom.c.
References MinInt().
Referenced by accelerate_and_move_object(), MinInt(), and object_collision().
| void MoveObjectAlongDirection | ( | short | obj, |
| const FixedVector * | direction, | ||
| short | distance ) |
Definition at line 873 of file geom.c.
References AddFixedVectors(), aShipPositionsArray, MoveObjectAlongDirection(), and SetVectorFixedPoint().
Referenced by MoveObjectAlongDirection().
| void negate_vector | ( | FixedVector * | vector | ) |
Definition at line 288 of file geom.c.
References negate_vector(), FixedVector::x, FixedVector::y, and FixedVector::z.
Referenced by ejection_sequence(), get_facing_range_from_object(), get_right_shape(), negate_vector(), new_view(), object_collision(), set_background_objects_rotation(), set_eye_direction_and_position(), and skew_randomly().
| void NormalizeAndScaleVector | ( | FixedVector * | vector, |
| int | scale ) |
Definition at line 900 of file geom.c.
References NormalizeAndScaleVector(), NormalizeFixedVector(), and ScaleFixedVector().
Referenced by accelerate_and_move_object(), NormalizeAndScaleVector(), and SetVectorFixedPoint().
| short NormalizeFixedVector | ( | FixedVector * | vector | ) |
Definition at line 471 of file geom.c.
References DivideFixed(), NormalizeFixedVector(), Vector_magnitude(), FixedVector::x, FixedVector::y, and FixedVector::z.
Referenced by auto_pilot_sequence(), explosion_shock_wave(), facing_to_object(), fix_objects_ijk(), get_facing_range_from_point(), get_right_shape(), launch_object(), MakeRandomNormalizedVector(), match_roll_orientation(), new_view(), NormalizeAndScaleVector(), NormalizeFixedVector(), object_collision(), position_relative(), set_background_objects_rotation(), set_eye_direction_and_position(), vector_angle(), and vector_length_in_dir().
| void point_at | ( | short | obj, |
| FixedVector | point ) |
Definition at line 152 of file geom.c.
References aShipFwdVec, aShipPositionsArray, ComputeVectorDelta(), fix_objects_ijk(), point_at(), shrink(), shrink_vector(), and void().
Referenced by approach(), auto_pilot_sequence(), fire_weapon(), init_hazard(), look_at(), point_at(), and SetFleetOverviewView().
| void point_capital_ship_at_object | ( | short | obj, |
| short | other ) |
Definition at line 818 of file geom.c.
References aShipPositionsArray, ComputeVectorDelta(), point_capital_ship_at_object(), and point_ship().
Referenced by point_capital_ship_at_object(), and tanker_intelligence().
| void point_parallel | ( | short | obj, |
| short | other ) |
Definition at line 866 of file geom.c.
References aShipFwdVec, point_parallel(), and point_ship().
Referenced by coming_home(), escort_buddy(), goto_formation(), point_parallel(), and return_to_buddy().
| void point_perpendicular | ( | short | obj, |
| short | other ) |
Definition at line 860 of file geom.c.
References aShipPositionsArray, point_perpendicular(), and point_perpendicular_to_point().
Referenced by defend_mission(), point_perpendicular(), and return_to_master().
| void point_perpendicular_to_point | ( | short | obj, |
| const FixedVector * | point ) |
Definition at line 850 of file geom.c.
References anYawTarget, 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 793 of file geom.c.
References acShipPointingModeList, anPitchGoal, anYawTarget, 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(), run_away(), and ShipAiState35().
| void point_ship_at_object | ( | short | obj, |
| short | other ) |
Definition at line 812 of file geom.c.
References aShipPositionsArray, point_ship_at_object(), and point_ship_at_point().
Referenced by imperial_formation(), Mkill_missile(), Mram_missile(), Msit_n_fire(), Msit_n_spin(), Mstrafe_enemy(), Msuicide_run(), Mtail_fire(), Mtarget_missile(), Mtry2tail(), Mturn_n_spin(), patrol_area(), point_ship_at_object(), rendezvous_mission(), return_to_buddy(), and streak_toward().
| void point_ship_at_point | ( | short | obj, |
| const FixedVector * | point ) |
Definition at line 802 of file geom.c.
References aShipPositionsArray, ComputeVectorDelta(), point_ship(), and point_ship_at_point().
Referenced by cruise_home(), cruise_to_destination(), goto_location(), Mline_up_drop(), Msit_n_spin(), 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 828 of file geom.c.
References aShipFwdVec, aShipPositionsArray, asObjectCollisionRadius, point_ship_at_point(), point_ship_behind_object(), and position_relative().
Referenced by Mzip_past(), and point_ship_behind_object().
| void point_ship_below_object | ( | short | obj, |
| short | other ) |
Definition at line 839 of file geom.c.
References aShipPositionsArray, aShipUpVector, 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 | hardpoint, | ||
| FixedVector * | position ) |
Definition at line 950 of file geom.c.
References aChildOffsets, aShipFwdVec, aShipPositionsArray, aShipRightVector, aShipUpVector, 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 172 of file geom.c.
References AddFixedVectors(), NormalizeFixedVector(), position_relative(), and ScaleFixedVector().
Referenced by 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 183 of file geom.c.
References aShipFwdVec, aShipPositionsArray, aShipRightVector, 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 363 of file geom.c.
References AddFixedVectors(), FillFixedVectorWithRandomComponents(), random_radial(), and RandomBelowOrEqual().
Referenced by approve_xyz(), and random_radial().
| short recalc_max_velocity | ( | short | ship | ) |
Definition at line 106 of file geom.c.
References acShipIonDriveDmg, anShipFuelsTable, asShipMaximumSpeedArray, celerate(), get_ship_max_velocity(), and recalc_max_velocity().
Referenced by damage_ion_drive(), drain_fuel(), recalc_max_velocity(), and set_objects_data().
| void rectangular_to_spherical | ( | const FixedVector * | rectangular, |
| SphericalVector * | spherical ) |
Definition at line 383 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 1002 of file geom.c.
References abHazardObjects, acShipRating, acWingmanMessageStatesArray, aeObjectClass, aeShipManeuversTable, aeShipSide, apObjShapeArray, asCapitalShipViewFramesTable, asObjDistancesTable, asObjectScreenXList, clear_alert(), FreePacketAndClear(), MANEUVER_NONE, nNavPointerObject, nYourWingman, OBJECT_CLASS_CAPITAL_SHIP, OBJECT_CLASS_NULL, remove_object(), and SIDE_NEUTRAL.
Referenced by animate_shape(), auto_pilot_sequence(), Create_explosion_debris(), cruise_home(), 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(), and set_up_action_sphere().
| void rotate_about_i | ( | short | angle, |
| FixedVector * | j, | ||
| FixedVector * | k ) |
Definition at line 508 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(), HandleFleetOverviewInput(), initialize_direction_view_frame(), rotate_about_i(), try_far_spot(), and update_star_field().
| void rotate_about_j | ( | short | angle, |
| FixedVector * | i, | ||
| FixedVector * | k ) |
Definition at line 528 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(), HandleFleetOverviewInput(), initialize_direction_view_frame(), rotate_about_j(), try_far_spot(), and update_star_field().
| void rotate_about_k | ( | short | angle, |
| FixedVector * | i, | ||
| FixedVector * | j ) |
Definition at line 548 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 1101 of file geom.c.
References aeObjectClass, anObjectRollRotationList, anObjectYawRotation, anObjPitchRot, asObjAfterburnerVelocities, asObjectCollisionRadius, check_for_lost_control(), ClampTo30(), DivideFixed(), 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 | ( | const FixedVector * | vector, |
| int | scale, | ||
| FixedVector * | result ) |
Definition at line 322 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(), chase_location(), CreateCannedSceneObject(), ejection_sequence(), explosion_shock_wave(), fire(), fire_weapon(), fix_velocity(), generate_stars(), get_front_spot(), get_rear_spot(), init_formation_burst(), init_hazard(), InitializeConstellationObject(), launch_object(), match_ship_to_eye(), Msit_n_spin(), new_view(), NormalizeAndScaleVector(), object_collision(), parse_view_script(), position_relative(), real_crash_time(), ScaleFixedVector(), servicetrack(), set_eye_direction_and_position(), SetFleetOverviewView(), ShowGameOverScreen(), ShowTigerClawEscapeScene(), start_dust(), steer_away_from_predicted_object(), Title_Sequence(), update_star_field(), and vector_component_in_dir().
| int __stdcall SeekPacketSection | ( | PacketSectionHandle * | handle, |
| int | offset, | ||
| short | origin ) |
Definition at line 34 of file geom.c.
References PacketSectionHandle::dataOffset, PacketSectionHandle::dataSize, PacketSectionHandle::file, PacketSectionHandle::position, SeekDataFile(), and SeekPacketSection().
Referenced by DecompressPacketSection(), and SeekPacketSection().
| void set_background_objects_rotation | ( | short | obj, |
| FixedVector * | direction ) |
Definition at line 1315 of file geom.c.
References alter_pitch(), alter_yaw(), ArcCos(), aShipRightVector, aShipUpVector, asObjScreenAngles, asObjScreenScalesArray, dot_product(), EYE_OBJECT, init_ijk(), negate_vector(), NormalizeFixedVector(), SphericalVector::pitch, rectangular_to_spherical(), 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().
| int set_ship_rotation_goals | ( | short | obj, |
| short | turnRate, | ||
| const FixedVector * | direction, | ||
| short | pointingMode, | ||
| short * | yawGoal, | ||
| short * | pitchGoal ) |
Definition at line 748 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 | ( | FixedVector * | p, |
| short | v ) |
Definition at line 907 of file geom.c.
References NormalizeAndScaleVector(), and SetVectorFixedPoint().
Referenced by make_shard(), MoveObjectAlongDirection(), send_at_point(), set_eye_direction_and_position(), and SetVectorFixedPoint().
| void ship_vs_point | ( | short | obj, |
| const FixedVector * | point ) |
Definition at line 704 of file geom.c.
References get_facing_range_from_point(), and ship_vs_point().
Referenced by goto_location(), patrol_area(), prevent_collision(), and ship_vs_point().
| void ship_vs_ship | ( | short | obj, |
| short | other ) |
Definition at line 710 of file geom.c.
References get_facing_range_from_object(), and ship_vs_ship().
Referenced by being_tailed(), fire_when_ready(), futurion_intelligence(), intelligence_events(), Mkill_missile(), Mstrafe_enemy(), patrol_area(), perform_maneuver(), and ship_vs_ship().
| unsigned int SignFixed | ( | int | v | ) |
Definition at line 246 of file geom.c.
References SignFixed().
Referenced by approach_speed(), and SignFixed().
| unsigned short SignShort | ( | short | v | ) |
| void SubtractFixedVectors | ( | FixedVector * | left, |
| FixedVector * | right, | ||
| FixedVector * | difference ) |
Definition at line 305 of file geom.c.
References SubtractFixedVectors(), FixedVector::x, FixedVector::y, and FixedVector::z.
Referenced by auto_pilot_sequence(), init_hazard(), object_collision(), set_eye_direction_and_position(), and SubtractFixedVectors().
Definition at line 1186 of file geom.c.
References aeObjectClass, aObjectViewPositionsList, aShipPositionsArray, asObjDistancesTable, asObjectCollisionRadius, asObjectCounterArray, asObjectScreenXList, asObjectScreenYArray, asObjectViewFrames, asObjScreenAngles, asObjScreenScalesArray, asPreviousObjectDistance, awObjectScales, ComputeVectorDelta(), DivideFixed(), draw_nav_pointer(), EYE_OBJECT, get_right_shape(), MultiplyFixed(), nClosestVisibleObject, nCurrentSpaceFrameValue, nNavPointerObject, nScreenWidth, 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_SHIP, OBJECT_CLASS_STAR, set_background_objects_rotation(), SPACE_LAST_MOVING_OBJECT, transform_objects_to_your_view(), transform_to_objects_frame(), and Vector_magnitude().
Referenced by Draw_3Space_Frame(), ShowCarrierLaunchSequence(), and transform_objects_to_your_view().
| void transform_to_objects_frame | ( | const FixedVector * | source, |
| FixedVector * | destination, | ||
| short | obj ) |
Definition at line 610 of file geom.c.
References aShipFwdVec, aShipRightVector, aShipUpVector, dot_product(), transform_to_objects_frame(), FixedVector::x, FixedVector::y, and FixedVector::z.
Referenced by apply_force_to_object(), draw_nav_pointer(), get_right_shape(), IsPointWithinEyeViewCone(), 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(), and update_star_field().
| short vector_angle | ( | FixedVector | left, |
| FixedVector | right ) |
Definition at line 451 of file geom.c.
References dot_product(), NormalizeFixedVector(), and vector_angle().
Referenced by fire(), hemisphere(), and vector_angle().
| void vector_component_in_dir | ( | const FixedVector * | vector, |
| const FixedVector * | direction, | ||
| FixedVector * | component ) |
Definition at line 497 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(), and vector_component_in_dir().
| void vector_cross_product | ( | const FixedVector * | left, |
| const FixedVector * | right, | ||
| FixedVector * | product ) |
Definition at line 459 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 485 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 255 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 280 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(), cruise_home(), find_squad_center(), initialize_object(), initialize_scripted_view(), locate_ship(), new_view(), object_collision(), RenderSpaceViewFrame(), run_away(), set_eye_direction_and_position(), Set_up_ship_info(), SetFleetOverviewView(), ShowGameOverScreen(), ShowTigerClawEscapeScene(), and zero_vector().
| signed char cCapitalShipLogicalFile |
Definition at line 14 of file geom.c.
Referenced by get_right_shape().
| FixedVector vNormalizedToTarget |
Definition at line 15 of file geom.c.
Referenced by get_facing_range_from_object(), and get_facing_range_from_point().