mirror of
https://github.com/Cesarus85/ringfall-mjolnir-vr.git
synced 2026-10-17 20:00:25 +02:00
The held grenade is drawn in front of the left palm (vr.grenade_right, _forward, _up from the grip) at 0.55 of its size (vr.grenade_scale). A hand-thrown grenade is no longer brought up to the projectile's final velocity, which made every throw as far; strength now runs from 0.25 to full at 5 m/s. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
129 lines
3.0 KiB
C
129 lines
3.0 KiB
C
/*
|
|
PROJECTILES.H
|
|
|
|
header included in hcex build.
|
|
*/
|
|
|
|
#ifndef __PROJECTILES_H
|
|
#define __PROJECTILES_H
|
|
#pragma once
|
|
|
|
#include "items/items.h"
|
|
|
|
/* ---------- constants */
|
|
|
|
/* ---------- macros */
|
|
|
|
#define projectile_get(index) \
|
|
((struct projectile_datum *)object_get_and_verify_type( \
|
|
(index), \
|
|
_object_mask_projectile))
|
|
|
|
/* ---------- structures */
|
|
|
|
struct projectile_definition;
|
|
|
|
struct _projectile_datum
|
|
{
|
|
unsigned long flags;
|
|
short action;
|
|
short hit_material_type;
|
|
long ignore_object_index;
|
|
long target_object_index;
|
|
long tracer_attachment_index;
|
|
real detonation_timer;
|
|
real detonation_timer_delta;
|
|
real arming_time;
|
|
};
|
|
|
|
struct projectile_datum
|
|
{
|
|
long definition_index;
|
|
struct _object_datum object;
|
|
struct _item_datum item;
|
|
struct _projectile_datum projectile;
|
|
};
|
|
|
|
typedef char projectile_target_object_index_offset_assert[
|
|
offsetof(struct projectile_datum, projectile.target_object_index) == 0x1E8
|
|
? 1
|
|
: -1];
|
|
typedef char projectile_detonation_timer_offset_assert[
|
|
offsetof(struct projectile_datum, projectile.detonation_timer) == 0x1F0
|
|
? 1
|
|
: -1];
|
|
typedef char projectile_arming_time_offset_assert[
|
|
offsetof(struct projectile_datum, projectile.arming_time) == 0x1F8
|
|
? 1
|
|
: -1];
|
|
|
|
/* ---------- prototypes/PROJECTILES.C */
|
|
|
|
void projectiles_initialize(
|
|
void);
|
|
void projectiles_initialize_for_new_map(
|
|
void);
|
|
void projectiles_dispose_from_old_map(
|
|
void);
|
|
void projectiles_dispose(
|
|
void);
|
|
void projectile_kill_tracer(
|
|
long projectile_index);
|
|
void projectiles_delete_all(
|
|
void);
|
|
void projectile_delete(
|
|
long projectile_index);
|
|
boolean dangerous_projectiles_near_player(
|
|
void);
|
|
real projectile_estimate_time_to_target(
|
|
struct projectile_definition const *definition,
|
|
real target_distance);
|
|
void projectile_set_target_object_index(
|
|
long projectile_index,
|
|
long target_object_index);
|
|
real projectile_get_ballistic_acceleration(
|
|
struct projectile_definition const *definition);
|
|
boolean projectile_aim(
|
|
struct projectile_definition const *definition,
|
|
real_point3d const *origin,
|
|
real_point3d const *target_point,
|
|
real const *override_velocity_max,
|
|
real *target_velocity_min,
|
|
real *target_ballistic_fraction_min,
|
|
real *forced_velocity,
|
|
boolean lob,
|
|
real_vector3d *result_aim_vector,
|
|
real *result_velocity,
|
|
real *result_ticks,
|
|
real *result_distance,
|
|
boolean *result_linear);
|
|
boolean projectile_aim_ballistic(
|
|
real base_velocity,
|
|
real gravity_scale,
|
|
real_point3d const *origin,
|
|
real_point3d const *target_point,
|
|
real *target_velocity_min,
|
|
real *target_ballistic_fraction_min,
|
|
real *forced_velocity,
|
|
boolean lob,
|
|
real_vector3d *result_aim_vector,
|
|
real *result_velocity,
|
|
real *result_ticks,
|
|
real *result_distance,
|
|
real *result_vertical_velocity,
|
|
real *result_horizontal_velocity);
|
|
#ifdef HALO_ANDROID
|
|
/* VR: a grenade thrown by the hand keeps the speed it was thrown at */
|
|
void projectile_set_thrown_by_hand(
|
|
long projectile_index);
|
|
#endif
|
|
void projectile_accelerate(
|
|
long projectile_index,
|
|
union real_vector3d const *acceleration);
|
|
|
|
/* ---------- globals */
|
|
|
|
/* ---------- public code */
|
|
|
|
#endif // __PROJECTILES_H
|