Kerbal Space Program  1.12.4
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Events Macros
Public Member Functions | Protected Attributes | List of all members
CommNet.Occluders.OccluderHorizonCulling Class Reference
Inheritance diagram for CommNet.Occluders.OccluderHorizonCulling:
CommNet.Occluder

Public Member Functions

override bool InRange (Vector3d source, double distance)
 Override this to false in case of a radius being 0 More...
 
 OccluderHorizonCulling (Transform transform, double radiusX, double radiusY, double radiusZ)
 The radii in each axis (in local space). Note that position and invRotation must be kept updated per tick. More...
 
override bool Raycast (Vector3d source, Vector3d dest)
 Does the ray from source to dest hit the occluder? NOTE: requires position to be updated, and invRotation as well (to rotate the positions to body-centric) via https://cesiumjs.org/2013/04/25/Horizon-culling/ More...
 
override void Update ()
 

Protected Attributes

CelestialBody body
 
QuaternionD invRotation
 
double radiusXRecip
 
double radiusYRecip
 
double radiusZRecip
 
Transform transform
 
bool useBody = false
 

Additional Inherited Members

- Public Attributes inherited from CommNet.Occluder
Vector3d position
 
double radius
 

Constructor & Destructor Documentation

CommNet.Occluders.OccluderHorizonCulling.OccluderHorizonCulling ( Transform  transform,
double  radiusX,
double  radiusY,
double  radiusZ 
)
inline

The radii in each axis (in local space). Note that position and invRotation must be kept updated per tick.

Parameters
radiusX
radiusY
radiusZ

Member Function Documentation

override bool CommNet.Occluders.OccluderHorizonCulling.InRange ( Vector3d  source,
double  distance 
)
inlinevirtual

Override this to false in case of a radius being 0

Parameters
source
distance
Returns

Reimplemented from CommNet.Occluder.

override bool CommNet.Occluders.OccluderHorizonCulling.Raycast ( Vector3d  source,
Vector3d  dest 
)
inlinevirtual

Does the ray from source to dest hit the occluder? NOTE: requires position to be updated, and invRotation as well (to rotate the positions to body-centric) via https://cesiumjs.org/2013/04/25/Horizon-culling/

Parameters
source
dest
Returns

< Swap if dest is actually closer than source

< Unit-sphere vector from body center to source

< Unit-sphere vector from body center to dest

< distance from source to sphere surface

< dot of source->dest and source->sphere surface, i.e. projection of source->dest along axis to sphere center

< then check the dot. If source->dest is not in the same direction as source->center, we're safe, else occluded.

Implements CommNet.Occluder.

override void CommNet.Occluders.OccluderHorizonCulling.Update ( )
inlinevirtual

Reimplemented from CommNet.Occluder.

Member Data Documentation

CelestialBody CommNet.Occluders.OccluderHorizonCulling.body
protected
QuaternionD CommNet.Occluders.OccluderHorizonCulling.invRotation
protected
double CommNet.Occluders.OccluderHorizonCulling.radiusXRecip
protected
double CommNet.Occluders.OccluderHorizonCulling.radiusYRecip
protected
double CommNet.Occluders.OccluderHorizonCulling.radiusZRecip
protected
Transform CommNet.Occluders.OccluderHorizonCulling.transform
protected
bool CommNet.Occluders.OccluderHorizonCulling.useBody = false
protected

The documentation for this class was generated from the following file: