Class QuakeMapScene
Base class for scenes that use Quake maps.
Implements
Inherited Members
Namespace: PopcorningGuineaPig.Engine.Quake
Assembly: PopcorningGuineaPig.Engine.dll
Syntax
public abstract class QuakeMapScene : Scene, IDisposable
Constructors
| Edit this page View SourceQuakeMapScene()
Creates a new QuakeMapScene.
Declaration
public QuakeMapScene()
Properties
| Edit this page View SourceCamera
The camera used for rendering the scene.
Declaration
protected object Camera { get; set; }
Property Value
| Type | Description |
|---|---|
| object |
DefaultSpawnPosition
The default spawn position for the player.
Declaration
protected Vector3 DefaultSpawnPosition { get; set; }
Property Value
| Type | Description |
|---|---|
| Vector3 |
DefaultSpawnRotation
The default spawn rotation for the player (in degrees).
Declaration
protected float DefaultSpawnRotation { get; set; }
Property Value
| Type | Description |
|---|---|
| float |
Map
The Quake map used by the scene.
Declaration
protected QuakeMap Map { get; }
Property Value
| Type | Description |
|---|---|
| QuakeMap |
PlayerSpawnEntityName
The player spawn entity class name to look for in the map.
Declaration
protected string PlayerSpawnEntityName { get; set; }
Property Value
| Type | Description |
|---|---|
| string |
Methods
| Edit this page View SourceCreateDefaultMap()
Creates a default map if no map is loaded.
Declaration
protected virtual void CreateDefaultMap()
FindPlayerSpawn()
Finds the player spawn position and rotation in the map.
Declaration
protected virtual void FindPlayerSpawn()
GetEntitiesByClassName(string)
Gets all entities of a specific class name.
Declaration
public List<QuakeMapEntity> GetEntitiesByClassName(string className)
Parameters
| Type | Name | Description |
|---|---|---|
| string | className | The class name to search for. |
Returns
| Type | Description |
|---|---|
| List<QuakeMapEntity> | A list of entities with the specified class name. |
GetEntityByClassName(string)
Gets the first entity of a specific class name.
Declaration
public QuakeMapEntity GetEntityByClassName(string className)
Parameters
| Type | Name | Description |
|---|---|---|
| string | className | The class name to search for. |
Returns
| Type | Description |
|---|---|
| QuakeMapEntity | The first entity with the specified class name, or null if none is found. |
GetPlayerSpawnPosition()
Gets the player spawn position.
Declaration
public Vector3 GetPlayerSpawnPosition()
Returns
| Type | Description |
|---|---|
| Vector3 | The player spawn position. |
GetPlayerSpawnRotation()
Gets the player spawn rotation.
Declaration
public float GetPlayerSpawnRotation()
Returns
| Type | Description |
|---|---|
| float | The player spawn rotation in degrees. |
LoadMap(string)
Loads a Quake map from the specified file path.
Declaration
public virtual bool LoadMap(string mapPath)
Parameters
| Type | Name | Description |
|---|---|---|
| string | mapPath | The path to the map file. |
Returns
| Type | Description |
|---|---|
| bool | True if the map was loaded successfully, false otherwise. |
RayCast(Vector3, Vector3, float, out Vector3, out Vector3, out QuakeMapEntity)
Performs a ray cast against the map geometry.
Declaration
public bool RayCast(Vector3 origin, Vector3 direction, float maxDistance, out Vector3 hitPoint, out Vector3 hitNormal, out QuakeMapEntity hitEntity)
Parameters
| Type | Name | Description |
|---|---|---|
| Vector3 | origin | The origin of the ray. |
| Vector3 | direction | The direction of the ray. |
| float | maxDistance | The maximum distance to check. |
| Vector3 | hitPoint | The point where the ray hits the map geometry, if any. |
| Vector3 | hitNormal | The normal of the surface at the hit point, if any. |
| QuakeMapEntity | hitEntity | The entity that was hit, if any. |
Returns
| Type | Description |
|---|---|
| bool | True if the ray hits something, false otherwise. |
RenderMap()
Renders the map.
Declaration
protected virtual void RenderMap()
Unload()
Unloads the scene and all associated resources.
Declaration
public override void Unload()
Overrides
| Edit this page View SourceUnloadMap()
Unloads the map and all associated resources.
Declaration
protected virtual void UnloadMap()