Barotrauma Client Doc
Barotrauma.Lights.ConvexHull Class Reference

Public Member Functions

 ConvexHull (Rectangle rect, bool isHorizontal, MapEntity parent)
 
bool LosIntersects (Vector2 pos1, Vector2 pos2)
 
void Rotate (Vector2 origin, float amount)
 
void Move (Vector2 amount)
 
void SetVertices (Vector2[] points, Vector2[] losPoints, bool mergeOverlappingSegments=true, Matrix? rotationMatrix=null)
 
bool Intersects (Rectangle rect)
 
void GetVisibleSegments (Vector2 viewPosition, List< Segment > visibleSegments)
 Returns the segments that are facing towards viewPosition More...
 
void RefreshWorldPositions ()
 
void CalculateLosVertices (Vector2 lightSourcePos)
 
void DebugDraw (SpriteBatch spriteBatch)
 
void Remove ()
 

Static Public Member Functions

static void RecalculateAll (Submarine sub)
 
static List< ConvexHullGetHullsInRange (Vector2 position, float range, Submarine ParentSub)
 

Public Attributes

float? MaxMergeLosVerticesDist
 Overrides the maximum distance a LOS vertex can be moved to make it align with a nearby LOS segment More...
 

Static Public Attributes

static List< ConvexHullListHullLists = new List<ConvexHullList>()
 
static BasicEffect shadowEffect
 
static BasicEffect penumbraEffect
 

Properties

VertexPositionColor[] ShadowVertices [get]
 
VertexPositionTexture[] PenumbraVertices [get]
 
int ShadowVertexCount [get]
 
int PenumbraVertexCount [get]
 
MapEntity ParentEntity [get]
 
bool Enabled [get, set]
 
float LastVertexChangeTime [get]
 The elapsed gametime when the vertices of this hull last changed More...
 
Rectangle BoundingBox [get]
 
bool IsInvalid [get]
 

Detailed Description

Definition at line 81 of file ConvexHull.cs.

Constructor & Destructor Documentation

◆ ConvexHull()

Barotrauma.Lights.ConvexHull.ConvexHull ( Rectangle  rect,
bool  isHorizontal,
MapEntity  parent 
)

Definition at line 138 of file ConvexHull.cs.

Member Function Documentation

◆ CalculateLosVertices()

void Barotrauma.Lights.ConvexHull.CalculateLosVertices ( Vector2  lightSourcePos)

Definition at line 517 of file ConvexHull.cs.

◆ DebugDraw()

void Barotrauma.Lights.ConvexHull.DebugDraw ( SpriteBatch  spriteBatch)

Definition at line 671 of file ConvexHull.cs.

◆ GetHullsInRange()

static List<ConvexHull> Barotrauma.Lights.ConvexHull.GetHullsInRange ( Vector2  position,
float  range,
Submarine  ParentSub 
)
static

Definition at line 711 of file ConvexHull.cs.

◆ GetVisibleSegments()

void Barotrauma.Lights.ConvexHull.GetVisibleSegments ( Vector2  viewPosition,
List< Segment visibleSegments 
)

Returns the segments that are facing towards viewPosition

Definition at line 470 of file ConvexHull.cs.

◆ Intersects()

bool Barotrauma.Lights.ConvexHull.Intersects ( Rectangle  rect)

Definition at line 454 of file ConvexHull.cs.

◆ LosIntersects()

bool Barotrauma.Lights.ConvexHull.LosIntersects ( Vector2  pos1,
Vector2  pos2 
)

Definition at line 314 of file ConvexHull.cs.

◆ Move()

void Barotrauma.Lights.ConvexHull.Move ( Vector2  amount)

Definition at line 345 of file ConvexHull.cs.

◆ RecalculateAll()

static void Barotrauma.Lights.ConvexHull.RecalculateAll ( Submarine  sub)
static

Definition at line 378 of file ConvexHull.cs.

◆ RefreshWorldPositions()

void Barotrauma.Lights.ConvexHull.RefreshWorldPositions ( )

Definition at line 481 of file ConvexHull.cs.

◆ Remove()

void Barotrauma.Lights.ConvexHull.Remove ( )

Definition at line 767 of file ConvexHull.cs.

◆ Rotate()

void Barotrauma.Lights.ConvexHull.Rotate ( Vector2  origin,
float  amount 
)

Definition at line 321 of file ConvexHull.cs.

◆ SetVertices()

void Barotrauma.Lights.ConvexHull.SetVertices ( Vector2[]  points,
Vector2[]  losPoints,
bool  mergeOverlappingSegments = true,
Matrix?  rotationMatrix = null 
)

Definition at line 402 of file ConvexHull.cs.

Member Data Documentation

◆ HullLists

List<ConvexHullList> Barotrauma.Lights.ConvexHull.HullLists = new List<ConvexHullList>()
static

Definition at line 83 of file ConvexHull.cs.

◆ MaxMergeLosVerticesDist

float? Barotrauma.Lights.ConvexHull.MaxMergeLosVerticesDist

Overrides the maximum distance a LOS vertex can be moved to make it align with a nearby LOS segment

Definition at line 104 of file ConvexHull.cs.

◆ penumbraEffect

BasicEffect Barotrauma.Lights.ConvexHull.penumbraEffect
static

Definition at line 85 of file ConvexHull.cs.

◆ shadowEffect

BasicEffect Barotrauma.Lights.ConvexHull.shadowEffect
static

Definition at line 84 of file ConvexHull.cs.

Property Documentation

◆ BoundingBox

Rectangle Barotrauma.Lights.ConvexHull.BoundingBox
get

Definition at line 134 of file ConvexHull.cs.

◆ Enabled

bool Barotrauma.Lights.ConvexHull.Enabled
getset

Definition at line 111 of file ConvexHull.cs.

◆ IsInvalid

bool Barotrauma.Lights.ConvexHull.IsInvalid
get

Definition at line 136 of file ConvexHull.cs.

◆ LastVertexChangeTime

float Barotrauma.Lights.ConvexHull.LastVertexChangeTime
get

The elapsed gametime when the vertices of this hull last changed

Definition at line 128 of file ConvexHull.cs.

◆ ParentEntity

MapEntity Barotrauma.Lights.ConvexHull.ParentEntity
get

Definition at line 108 of file ConvexHull.cs.

◆ PenumbraVertexCount

int Barotrauma.Lights.ConvexHull.PenumbraVertexCount
get

Definition at line 99 of file ConvexHull.cs.

◆ PenumbraVertices

VertexPositionTexture [] Barotrauma.Lights.ConvexHull.PenumbraVertices
get

Definition at line 97 of file ConvexHull.cs.

◆ ShadowVertexCount

int Barotrauma.Lights.ConvexHull.ShadowVertexCount
get

Definition at line 98 of file ConvexHull.cs.

◆ ShadowVertices

VertexPositionColor [] Barotrauma.Lights.ConvexHull.ShadowVertices
get

Definition at line 96 of file ConvexHull.cs.