ParaEngine Extension

an extension library to all ParaEngine namespaces

Title an extension library to all ParaEngine namespaces
Author(s) LiXizhi
Date 2006/11/12
File script/ide/ParaEngineExtension.lua

Description

TIP Sample Code

NPL.load("(gl)script/ide/ParaEngineExtension.lua");

Member Functions

ParaScene.GetCharacter

it first searches the global object, if not found, it will search the OPC list. always check if the object is valid() upon receive.

syntax

function ParaScene.GetCharacter(charName)

parameters

charName  

ParaScene.CaptureSceneState

capture the current scene state to be restored later on. e.g. local state = CaptureSceneState() -- change scene state and render ... RestoreSceneState(state);

-- options: a table or nil. if nil, it will capture everything.

  • return __ : return the captured scene state

syntax

function ParaScene.CaptureSceneState(options)

parameters

options  
return return the captured scene state

ParaScene.RestoreSceneState

restore scene state

syntax

function ParaScene.RestoreSceneState(state)

parameters

state  

ParaCamera.SetLookAtPos

set the look at position of the camera. It uses an invisible avatar as the camera look at position. after calling this function, please call SetEyePos(facing, height, angle) to change the camera eye position.

syntax

function ParaCamera.SetLookAtPos(x, y, z)

parameters

x  
y  
z  

ParaCamera.GetEyePos

it returns polar coordinate system.

syntax

function ParaCamera.GetEyePos()

parameters

return , LifeupAngle, CameraRotY

ParaCamera.GetDummyObject

create/get the dummy camera object for the camera look position.

syntax

function ParaCamera.GetDummyObject()

ParaCamera.SetEyePos

set the camera eye position by camera object distance, life up angle and rotation around the y axis. One must call SetLookAtPos() before calling this function. e.g.ParaCamera.SetEyePos(5, 1.3, 0.4);

syntax

function ParaCamera.SetEyePos(camobjDist, LifeupAngle, CameraRotY)

parameters

camobjDist  
LifeupAngle  
CameraRotY  

ParaAsset.ClearTextureCache

clear all cached textures.

syntax

function ParaAsset.ClearTextureCache()

ParaAsset.SyncRemoteTexture

[[ This function is only used internally. It is called automatically when the ParaEngine Core detects that a texture is a remote texture.

  • note __ : One shall never call this function explicitly. In scripting interface, we can call LoadRemoteTexture() instead
Load a texture from remote file. It first checks if the file is available from the local texture cache, if yes, it will immediately use the local copy, before refreshing from the network. In either case, a thread is used to synchronize with the remote server. The only exception is that the filename contains a CRC32 parameter, where the remote sync is skipped if CRC match. ]]

syntax

function ParaAsset.SyncRemoteTexture(FileUrl)

parameters

FileUrl  

ParaAsset.LoadRemoteTexture

[[ Load a remote texture explicitly. This function differs from the original LoadTexture() that it allows you to specify a loadingtexture to display while the texture is being downloaded.

  • param filename : http texture
note3
crc32 code can be appended to file name, so that the same file does not need to be downloaded multiple times if local and server version match. such as "http://www.paraengine.com/images/index_12.png?CRC32=0".
  • param loadingtexture : while filename is being downloaded, this texture will be used.
  • return __ : texture is returned.
]]

syntax

function ParaAsset.LoadRemoteTexture(filename, loadingtexture)

parameters

| filename | http texture

note3
crc32 code can be appended to file name, so that the same file does not need to be downloaded multiple times if local and server version match. such as "http://www.paraengine.com/images/index_12.png?CRC32=0". |
loadingtexture  
| return | texture is returned. ]] |
Topic revision: r1 - 2008-02-29 - LiXizhi
 
This site is powered by the TWiki collaboration platform Powered by PerlCopyright © 2008-2024 by the contributing authors. All material on this collaboration platform is the property of the contributing authors.
Ideas, requests, problems regarding TWiki? Send feedback