small update

This commit is contained in:
turanszkij
2015-12-23 23:27:55 +01:00
parent 328de81c70
commit 9ace56df40
3 changed files with 29 additions and 11 deletions
+20 -3
View File
@@ -4,10 +4,11 @@ The documentation completion is still pending....
## Contents
1. Introduction and usage
2. Engine manipulation
2. Common Tools
3. Engine manipulation
1. BackLog (Console)
2. Renderer
3. Utility Tools
4. Utility Tools
1. Font
2. Sprite
1. ImageEffects
@@ -53,6 +54,22 @@ In the startup file, you can specify any startup logic, for example loading cont
The setting up and usage of the BackLog is the responsibility of the target application, but the recommended way to set it up
is included in all of the demo projects. It is mapped to te HOME button by default.
## Common Tools
This section describes the common tools for scripting which are not necessarily engine features.
- signal(string name)
- waitSignal(string name)
- runProcess(function func)
- waitSeconds(float seconds)
- getprops(table object)
- len(table object)
- backlog_post_list(table list)
- update()
- render()
- math.lerp(float a,b,t)
- math.clamp(float x,min,max)
- math.saturate(float x)
- math.round(float x)
## Engine manipulation
The scripting API provides functions for the developer to manipulate engine behaviour or query it for information.
@@ -100,7 +117,7 @@ You can use the Renderer with the following functions, all of which are in the g
- SetDebugBoxesEnabled(bool enabled)
- SetVSyncEnabled(opt bool enabled)
- SetPhysicsParams(opt bool rigidBodyPhysicsEnabled, opt bool softBodyPhysicsEnabled, opt int softBodyIterationCount)
- Pick(Ray ray, opt PICKTYPE pickType) : Object? object, Vector position,normal
- Pick(Ray ray, opt PICKTYPE pickType) : Object? object, Vector position,normal, float distance
- DrawLine(Vector origin,end, opt Vector color)
- PutWaterRipple(String imagename, Vector position)
- ClearWorld()
+6 -6
View File
@@ -76,12 +76,6 @@ void MainComponent::activateComponent(RenderableComponent* component, int fadeFr
void MainComponent::run()
{
static bool startupScriptProcessed = false;
if (!startupScriptProcessed) {
wiLua::GetGlobal()->RunFile("startup.lua");
startupScriptProcessed = true;
}
static wiTimer timer = wiTimer();
static double accumulator = 0.0;
const double elapsedTime = timer.elapsed() / 1000.0;
@@ -113,6 +107,12 @@ void MainComponent::run()
Render();
wiRenderer::Present(bind(&MainComponent::Compose, this));
static bool startupScriptProcessed = false;
if (!startupScriptProcessed) {
wiLua::GetGlobal()->RunFile("startup.lua");
startupScriptProcessed = true;
}
}
void MainComponent::Update()
+3 -2
View File
@@ -130,7 +130,7 @@ namespace wiRenderer_BindLua
stringstream ss("");
for (map<string, vector<wiEmittedParticle*> >::iterator it = wiRenderer::emitterSystems.begin(); it != wiRenderer::emitterSystems.end(); ++it)
{
ss << it->first << endl;
ss << it->first << "(" << it->second.size() << ")" << endl;
}
wiLua::SSetString(L, ss.str());
return 1;
@@ -429,7 +429,8 @@ namespace wiRenderer_BindLua
Luna<Object_BindLua>::push(L, new Object_BindLua(pick.object));
Luna<Vector_BindLua>::push(L, new Vector_BindLua(XMLoadFloat3(&pick.position)));
Luna<Vector_BindLua>::push(L, new Vector_BindLua(XMLoadFloat3(&pick.normal)));
return 3;
wiLua::SSetFloat(L, pick.distance);
return 4;
}
}
return 0;