|
Enfusion Script API
|
derived class connected to gamelib to implement game related features More...
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) |
| Creates single visual mark, e.g. | |
| 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) |
| Creates single visual mark, e.g. | |
| proto external void | OutlineEntity (notnull IEntity ent, notnull Color color, float occlOpacity=1.0, float fillOpacity=0.0, bool inclChildren=false) |
| Outlines an entity in the current frame. | |
| proto external void | OutlineEntityGroup (notnull array< IEntity > entities, notnull Color color, float occlOpacity=1.0, float fillOpacity=0.0) |
| Outlines a group of entities in the current frame. | |
| proto external void | ReloadSystems () |
| Reload all systems, by deleting all current systems, and create them again. | |
| proto external WorldSystem | FindSystem (TypeName type) |
| Find a world system based on its type. | |
| proto external WorldSystems | GetSystems () |
| Access world systems associated with this world. | |
Public Member Functions inherited from BaseWorld | |
| proto external int | GetNumEntities (int subScene) |
| Returns number of loaded entities in certain sub scene. | |
| proto external EntityID | GetEntity (int subScene, int entityIndex) |
| returns loaded entity ID | |
| 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 available. | |
| 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, TraceFilterCallback filterCallback=null) |
| Traces shape collision at start position, return <0 if we hit something. | |
| proto external float | TraceMove (inout TraceParam param, TraceFilterCallback filterCallback=null) |
| Traces shape movement along start->end, return 0..1 if trace was sucessfull. | |
| proto external void | AsyncTraceMove (inout TraceParam param, AsyncTraceFinishedCallback finishedCallback) |
| Traces shape movement along start->end asynchronously, callbeck is called when finished. | |
| 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. | |
derived class connected to gamelib to implement game related features
| 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.
| entity | entity where the Track should be created |
| origin | first point of the decal, nothing is done now |
| project | projection direction (length is far clipping distance) |
| nearclip | near clipping distance |
| farclip | far clipping distance |
| materialName | Material used for decal |
| size | size of decal |
| stretch | stretch of decal |
| lifetime | Lifetime in seconds, if created with zero or negative value it's used as static and the pointer to decal is returned |
| color | color of decal |
| atlasNum | which image num to take in case of atlas |
| 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.
| entity | entity where the Track should be created |
| matrix | projection matrix of decal |
| nearclip | near clipping distance |
| farclip | far clipping distance |
| materialName | Material used for decal |
| size | size of decal |
| stretch | stretch of decal |
| lifetime | Lifetime in seconds, if created with zero or negative value it's used as static and the pointer to decal is returned |
| color | color of decal |
| atlasNum | which image num to take in case of atlas |
| proto external WorldSystem World.FindSystem | ( | TypeName | type | ) |
Find a world system based on its type.
| proto external WorldSystems World.GetSystems | ( | ) |
Access world systems associated with this world.
| proto external void World.OutlineEntity | ( | notnull IEntity | ent, |
| notnull Color | color, | ||
| float | occlOpacity = 1.0, | ||
| float | fillOpacity = 0.0, | ||
| bool | inclChildren = false ) |
Outlines an entity in the current frame.
To be called every frame.
| ent | The entity to outline |
| color | Color of the outline in the linear color space (and also of a fill - if used) |
| occlOpacity | Alpha of an occluded part of the outline |
| fillOpacity | Alpha of the fill (of occluded parts of the entity), 0 to turn the fill off |
| inclChildren | true to outline the entity together with its child entities |
| proto external void World.OutlineEntityGroup | ( | notnull array< IEntity > | entities, |
| notnull Color | color, | ||
| float | occlOpacity = 1.0, | ||
| float | fillOpacity = 0.0 ) |
Outlines a group of entities in the current frame.
The entities will be outlined together (without any intersections). To be called every frame.
| entities | The group of entities to outline |
| color | Color of the outline in the linear color space (and also of a fill - if used) |
| occlOpacity | Alpha of an occluded part of the outline |
| fillOpacity | Alpha of the fill (of occluded parts of the entity), 0 to turn the fill off |
| proto external void World.ReloadSystems | ( | ) |
Reload all systems, by deleting all current systems, and create them again.