Enfusion Script API
Loading...
Searching...
No Matches
Public Member Functions | List of all members
World Interface Reference

derived class connected to gamelib to implement game related features More...

Inheritance diagram for World:
[legend]

Public Member Functions

proto external Decal CreateDecal (notnull IEntity entity, vector origin, vector project, float nearclip, float farclip, float angle, float size, float stretch, string materialName, float lifetime, int color, int atlasNum=0)
 
proto external Decal CreateDecal2 (notnull IEntity entity, vector matrix[4], float nearclip, float farclip, float size, float stretch, string materialName, float lifetime, int color, int atlasNum=0)
 
proto external void ReloadSystems ()
 Reload all systems, by deleting all current systems, and create them again.
 
proto external BaseSystem FindSystem (TypeName type)
 Find a system from his type.
 
- Public Member Functions inherited from BaseWorld
proto external float GetSurfaceY (float x, float z)
 
proto external void GetActiveEntities (notnull out array< IEntity > entities)
 
proto external bool QueryEntitiesByLine (vector from, vector to, QueryEntitiesCallback addEntity, QueryEntitiesCallback filterEntity=null, EQueryEntitiesFlags queryFlags=EQueryEntitiesFlags.ALL)
 Query for entities on the line.
 
proto external bool QueryEntitiesByAABB (vector mins, vector maxs, QueryEntitiesCallback addEntity, QueryEntitiesCallback filterEntity=null, EQueryEntitiesFlags queryFlags=EQueryEntitiesFlags.ALL)
 Query for entities touched by axis aligned box.
 
proto external bool QueryEntitiesBySphere (vector center, float radius, QueryEntitiesCallback addEntity, QueryEntitiesCallback filterEntity=null, EQueryEntitiesFlags queryFlags=EQueryEntitiesFlags.ALL)
 Query for entities touched by sphere.
 
proto external bool QueryEntitiesByBeveledLine (vector from, vector to, vector bevelMins, vector bevelMaxs, QueryEntitiesCallback addEntity, QueryEntitiesCallback filterEntity=null, EQueryEntitiesFlags queryFlags=EQueryEntitiesFlags.ALL)
 Query for entities on the beveled line (sweeping test by AABB) Entities are roughly sorted by distance from start to end of line.
 
proto external bool QueryEntitiesByOBB (vector mins, vector maxs, vector matrix[4], QueryEntitiesCallback addEntity, QueryEntitiesCallback filterEntity=null, EQueryEntitiesFlags queryFlags=EQueryEntitiesFlags.ALL)
 Query for entities touched by oriented box.
 
proto external void SchedulePreload (vector pos, float radius)
 
proto external void GetBoundBox (out vector mins, out vector maxs)
 
proto external bool IsOcean ()
 Is ocean availabled.
 
proto external float GetOceanHeight (float worldX, float worldZ)
 Get water ocean height at given point.
 
proto external vector GetOceanHeightAndDisplace (float worldX, float worldZ)
 Get water ocean height and displacement at given point, returns vector(displaceX, height, displaceZ)
 
proto external float GetOceanBaseHeight ()
 return base ocean level
 
proto external bool IsOceanEnabledInCamera (int camera)
 is in camera ocean enabled?
 
proto external void EnabledOceanInCamera (int camera, bool enable)
 enable ocean render in some camera
 
proto external void RegisterWaterBody (notnull IEntity ent, ResourceName matName)
 
proto external void RemoveWaterBody (notnull IEntity ent)
 
proto external void RemoveDecal (Decal decal)
 remove decal
 
proto external TrackDecal CreateTrackDecal (IEntity entity, vector origin, vector normal, float edgeSize, float lifeTime, string materialName, Decal prevDecal, float alpha)
 Creates continous visual mark, e.g.
 
proto external int GetCurrentCameraId ()
 
proto external void SetCamera (int cam, vector origin, vector angle)
 Changes camera position.
 
proto external void GetCamera (int cam, out vector mat[4])
 
proto external void GetCurrentCamera (out vector mat[4])
 
proto external void SetCameraEx (int cam, const vector mat[4])
 Changes camera matrix.
 
proto external void SetCameraVerticalFOV (int cam, float fovy)
 
proto external void SetCameraNearPlane (int cam, float nearplane)
 Default 5 units.
 
proto external void SetCameraFarPlane (int cam, float farplane)
 Default 160000 units.
 
proto external void SetCameraHDRBrightness (int cam, float hdrBrightness)
 set HDR camera exposure (if hdrBrightness > 0, camera is set to manual mode with this exposure, set -1 to enable again auto mode)
 
proto external void AdjustCameraEV (int cam, float EV)
 adjust camera EV (light stops), 0 = no adjustment, both positive/negative values are allowed
 
proto external float GetCameraHDRBrightness (int cam)
 Returns actual camera HDR exposure.
 
proto external float GetCameraSceneMiddleBrightness (int cam)
 Returns actual camera normalized scene middle brightness.
 
proto external void SetCameraPostProcessEffect (int cam, int priority, PostProcessEffectType type, string materialPath)
 set postprocess effect to camera To disable effect in some prioroty ppEffect, just set effectName or name to NULL
 
proto external void SetCameraType (int cam, CameraType type)
 
proto external void SetCameraLensFlareSet (int cam, CameraLensFlareSetType lensFlareSetType, string userLensFlareSetName)
 Set lens flare set for given camera.
 
proto external vector ProjectWorldToViewport (vector pos, int cam, int width, int height)
 Project a position from world to viewport of given resolution.
 
proto external vector ProjectViewportToWorld (float x, float y, int cam, int width, int height, out vector outDir)
 Project a position from viewport of given resolution to world.
 
proto external bool TraceLineToEntity (notnull IEntity ent, vector start, vector end, Class placeHolder=null)
 
proto external float TracePosition (inout TraceParam param, TraceEntitiesCallback filtercallback)
 
proto external float TraceMove (inout TraceParam param, TraceEntitiesCallback filtercallback)
 
proto external float GetWorldTime ()
 Returns current lifetime of the World in milliseconds.
 
proto external WorldTimestamp GetTimestamp ()
 Returns current timestamp of the World.
 
proto external int GetFrameNumber ()
 Returns current frame of the World.
 
proto external float GetTimeScale ()
 Returns actual time scale of world, can be different from engine time scale.
 
proto external float GetTimeSlice ()
 Returns time slice of the world.
 
proto external float GetFixedTimeSlice ()
 Returns fixed time slice of the world.
 
proto external float GetPhysicsTimeSlice ()
 Returns physics time slice of the world.
 
proto external IEntity FindEntityByName (string name)
 
proto external IEntity FindEntityByID (EntityID ID)
 
proto external bool IsEditMode ()
 Returns true during edit mode in Workbench and in Ingame editor.
 
proto external void UpdateEntities ()
 Update active entities in the world, do not call from inside another world update (e.g. from IEntity::EOnXXX)
 
- Public Member Functions inherited from pointer
proto string ToString ()
 

Additional Inherited Members

- Static Public Member Functions inherited from BaseWorld
static proto SharedItemRef CreateWorld (string type, string name)
 Create new empty BaseWorld.
 

Detailed Description

derived class connected to gamelib to implement game related features

Member Function Documentation

◆ CreateDecal()

proto external Decal World.CreateDecal ( notnull IEntity  entity,
vector  origin,
vector  project,
float  nearclip,
float  farclip,
float  angle,
float  size,
float  stretch,
string  materialName,
float  lifetime,
int  color,
int  atlasNum = 0 
)
Creates single visual mark, e.g. from shots, version with projection vector and angle

when lifetime=0, pointer to decal is returned, that can be removed by RemoveDecal then

Parameters
entityentity where the Track should be created
originfirst point of the decal, nothing is done now
projectprojection direction (length is far clipping distance)
nearclipnear clipping distance
farclipfar clipping distance
materialNameMaterial used for decal
sizesize of decal
stretchstretch of decal
lifetimeLifetime in seconds, if created with zero or negative value it's used as static and the pointer to decal is returned
colorcolor of decal
atlasNumwhich image num to take in case of atlas
Returns
Decal pointer for static decals or null if the decal is dynamic or wasn't created for some reason (invalid material, NoDecal flag, ...)

◆ CreateDecal2()

proto external Decal World.CreateDecal2 ( notnull IEntity  entity,
vector  matrix[4],
float  nearclip,
float  farclip,
float  size,
float  stretch,
string  materialName,
float  lifetime,
int  color,
int  atlasNum = 0 
)
Creates single visual mark, e.g. from shots, version with exact matrix

when lifetime=0, pointer to decal is returned, that can be removed by RemoveDecal then

Parameters
entityentity where the Track should be created
matrixprojection matrix of decal
nearclipnear clipping distance
farclipfar clipping distance
materialNameMaterial used for decal
sizesize of decal
stretchstretch of decal
lifetimeLifetime in seconds, if created with zero or negative value it's used as static and the pointer to decal is returned
colorcolor of decal
atlasNumwhich image num to take in case of atlas
Returns
Decal pointer for static decals or null if the decal is dynamic or wasn't created for some reason (invalid material, NoDecal flag, ...)

◆ FindSystem()

proto external BaseSystem World.FindSystem ( TypeName  type)

Find a system from his type.

◆ ReloadSystems()

proto external void World.ReloadSystems ( )

Reload all systems, by deleting all current systems, and create them again.


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