Class DaggerfallStaticDoors
Stores an array of static doors. Exposes helpers to check doors in correct world space.
Namespace: DaggerfallWorkshop
Assembly: Assembly-CSharp.dll
Syntax
[Serializable]
public class DaggerfallStaticDoors : MonoBehaviour
Fields
| Improve this Doc View SourceDoors
Declaration
public StaticDoor[] Doors
Field Value
Type | Description |
---|---|
StaticDoor[] |
Methods
| Improve this Doc View SourceFindClosestDoor(Vector3, StaticDoor[], out StaticDoor)
Finds closest door in any array of static doors. Owner position and rotation must be set.
Declaration
public static Vector3 FindClosestDoor(Vector3 position, StaticDoor[] doors, out StaticDoor closestDoorOut)
Parameters
Type | Name | Description |
---|---|---|
Vector3 | position | Position to find closest door to. |
StaticDoor[] | doors | Door array. |
StaticDoor | closestDoorOut |
Returns
Type | Description |
---|---|
Vector3 | Position of closest door in world space. |
FindClosestDoorToPlayer(Vector3, StaticDoor[], out Vector3, out Int32)
Find closest door to player position in world space. Owner position and rotation must be set.
Declaration
public static bool FindClosestDoorToPlayer(Vector3 playerPos, StaticDoor[] doors, out Vector3 doorPosOut, out int doorIndexOut)
Parameters
Type | Name | Description |
---|---|---|
Vector3 | playerPos | Player position in world space. |
StaticDoor[] | doors | |
Vector3 | doorPosOut | Position of closest door in world space. |
Int32 | doorIndexOut | Door index in Doors array of closest door. |
Returns
Type | Description |
---|---|
Boolean |
FindClosestDoorToPlayer(Vector3, Int32, out Vector3, out Int32, DoorTypes)
Find closest door to player position in world space.
Declaration
public bool FindClosestDoorToPlayer(Vector3 playerPos, int record, out Vector3 doorPosOut, out int doorIndexOut, DoorTypes requiredDoorType = DoorTypes.None)
Parameters
Type | Name | Description |
---|---|---|
Vector3 | playerPos | Player position in world space. |
Int32 | record | Door record index. |
Vector3 | doorPosOut | Position of closest door in world space. |
Int32 | doorIndexOut | Door index in Doors array of closest door. |
DoorTypes | requiredDoorType |
Returns
Type | Description |
---|---|
Boolean |
FindDoorsInCollections(DaggerfallStaticDoors[], DoorTypes)
Finds all doors of type across multiple door collections.
Declaration
public static StaticDoor[] FindDoorsInCollections(DaggerfallStaticDoors[] doorCollections, DoorTypes type)
Parameters
Type | Name | Description |
---|---|---|
DaggerfallStaticDoors[] | doorCollections | Door collections. |
DoorTypes | type | Type of door to search for. |
Returns
Type | Description |
---|---|
StaticDoor[] | Array of matching doors. |
FindLowestOutermostDoor(Int32, out Vector3, out Int32)
Find the lowest, farthest from building origin door position in world space.
Declaration
public bool FindLowestOutermostDoor(int record, out Vector3 doorPosOut, out int doorIndexOut)
Parameters
Type | Name | Description |
---|---|---|
Int32 | record | Door record index. |
Vector3 | doorPosOut | Position of closest door in world space. |
Int32 | doorIndexOut | Door index in Doors array of closest door. |
Returns
Type | Description |
---|---|
Boolean | Whether or not we found a door |
GetDoorNormal(StaticDoor)
Gets door normal in world space. Owner position and rotation must be set.
Declaration
public static Vector3 GetDoorNormal(StaticDoor door)
Parameters
Type | Name | Description |
---|---|---|
StaticDoor | door | Door to calculate normal for. |
Returns
Type | Description |
---|---|
Vector3 | Normal pointing away from door in world. |
GetDoorNormal(Int32)
Gets world transformed normal of door at index.
Declaration
public Vector3 GetDoorNormal(int index)
Parameters
Type | Name | Description |
---|---|---|
Int32 | index | Door index. |
Returns
Type | Description |
---|---|
Vector3 | Normal pointing away from door in world. |
GetDoorPosition(StaticDoor)
Gets door position in world space. Owner position and rotation must be set.
Declaration
public static Vector3 GetDoorPosition(StaticDoor door)
Parameters
Type | Name | Description |
---|---|---|
StaticDoor | door |
Returns
Type | Description |
---|---|
Vector3 | Door position in world space. |
GetDoorPosition(Int32)
Gets door position in world space.
Declaration
public Vector3 GetDoorPosition(int index)
Parameters
Type | Name | Description |
---|---|---|
Int32 | index | Door index. |
Returns
Type | Description |
---|---|
Vector3 | Door position in world space. |
GetParentRMBBlock()
Gets the first parent RMB block of this door component.
Declaration
public DaggerfallRMBBlock GetParentRMBBlock()
Returns
Type | Description |
---|---|
DaggerfallRMBBlock |
HasHit(Vector3, out StaticDoor)
Check for a door hit in world space.
Declaration
public bool HasHit(Vector3 point, out StaticDoor doorOut)
Parameters
Type | Name | Description |
---|---|---|
Vector3 | point | Hit point from ray test in world space. |
StaticDoor | doorOut | StaticDoor out if hit found. |
Returns
Type | Description |
---|---|
Boolean | True if point hits a static door. |