BulletProperties
Read-only bullet values and trajectory precomputation.
Source: src/Ballistics/BulletProperties.cs. Create assets using Create → RSB → BulletProperties.
| Property | Type / units |
|---|---|
DragModel | BallisticsUtility.DragGModel |
MuzzleVelocity | float, m/s |
Mass | float, grams |
Diameter, Length, BarrelTwist | float, millimetres |
StepTime | float, fixed at 0.01 seconds |
LifeTime | float, seconds |
BallisticCoefficient | float |
UseWind, UseAirResistance, UseSpinDrift | bool |
IsZeroCalculated | bool |
DamageProfile | BulletDamageProfile, or null when unassigned |
Use damage profiles to configure ammunition damage independently of physical properties. Hit listeners can read the assigned profile through point.m_properties.DamageProfile.
These properties are read-only. Configure the serialized asset in the Inspector. m_zeroCalculated is public for internal use; call ActivateBullet rather than assigning it. m_environmentProperties is the editor preview reference.
float GetZeroAngleAtDistance(float distance)
BulletTrajectoryInfo CalculateTrajectoryForDistance(float distance,
Vector3 fireDirection, float zeroDistance = 0.0f,
bool dynamicCalculation = false)BulletTrajectoryInfo holds m_position (Vector3), m_time, m_givenZeroDistance and m_calculatedZeroAngle (floats). These calculations support zeroing and scope display. GetZeroAngleAtDistance returns zero when no matching distance is cached.
The calculation uses forward motion, gravity and optional drag. It is not a full collision, wind or spin-drift replay. Non-dynamic results are cached by distance and given zero distance; changing an environment does not automatically invalidate them. dynamicCalculation: true bypasses the cache for that call. Keep distances reachable and inputs valid: the loop has no lifetime cutoff.