Leviathan  0.8.0.0
Leviathan game engine
Leviathan Namespace Reference

The access mask controls which registered functions and classes a script sees. More...

Namespaces

 GUI
 
 KeyMapping
 
 Script
 
 Sound
 
 Test
 

Classes

struct  AngelScriptTypeIDResolver
 Helper for querying each type for their corresponding angelscript type once. More...
 
struct  AngelScriptTypeIDResolver< asIScriptFunction * >
 
struct  AngelScriptTypeIDResolver< asIScriptObject * >
 
struct  AngelScriptTypeIDResolver< void >
 
class  Animated
 Entity plays animations on an Ogre::Item. More...
 
class  AnimationTimeAdder
 Handles updating time of Ogre animations. More...
 
class  AppDef
 
class  AudioSource
 Small ReferenceCounted wrapper around a sound stream. More...
 
class  AutoUpdateableObject
 
class  BaseComponentState
 Base for all component state classes. More...
 
class  BaseConstraint
 
class  BaseCustomJoint
 Base class for custom joint types defined for use by this class. More...
 
class  BaseDelegateSlot
 Base class for all delegate types. More...
 
class  BaseEventData
 Base type for all event data types. More...
 
class  BaseGameSpecificPacketFactory
 Base class that is passed to the list of type handlers to GameSpecificPacketHandler. More...
 
class  BaseGameSpecificRequestPacket
 Base class for all user defined request packets. More...
 
class  BaseGameSpecificResponsePacket
 Base class for all user defined response packets. More...
 
class  BaseNotifiable
 
class  BaseNotifiableAll
 Specialized class for accepting all parent/child objects. More...
 
class  BaseNotifier
 
class  BaseNotifierAll
 Specialized class for accepting all parent/child objects. More...
 
class  BasicPool
 A tiny wrapper around boost pool. More...
 
class  BoxGeometry
 Entity has a box for geometry/model, possibly also physics. More...
 
class  CachedComponentCollectionHolder
 
class  CallableObject
 
class  Camera
 Properties that a camera entity has (will also need a Position component) More...
 
class  CEFApplicationKeeper
 Keeps certain CEF objects allocated for long enough. More...
 
class  CharWithIndex
 Helper class for indexing. More...
 
class  ClientApplication
 
class  ClientInterpolationEventData
 Data for EVENT_TYPE_CLIENT_INTERPOLATION. More...
 
class  CommandHandler
 Handles all commands sent by the players on the server. More...
 
class  CommandSender
 Represents an entity that can execute commands. More...
 
class  ComplainOnce
 
class  Component
 Base class for all components. More...
 
struct  ComponentData
 Base class for all component data. More...
 
class  ComponentHelpers
 brief Class containing residue static helper functions More...
 
class  ComponentHolder
 
class  ComponentState
 Base class for storing component states. More...
 
struct  ComponentTypeInfo
 
class  ComponentWithStates
 Alternative base class for Component that creates distinct state objects. More...
 
class  ConditionalDelayedTask
 Encapsulates a function that can later be ran in a free thread. More...
 
class  ConditionalTask
 Encapsulates a function that can later be ran in a free thread. More...
 
class  ConnectedPlayer
 A class that represents a human player. More...
 
class  Connection
 Class that handles a single connection to another instance. More...
 
class  ConsoleInput
 
class  ConsoleLogger
 Logger for console output to the standard logger. More...
 
class  ConstraintData
 Base class for constraint data types, used to serialize constraint states to state objects. More...
 
class  Convert
 Holds common conversion functions. More...
 
class  CustomCommandHandler
 Implement this interface to be able to handle custom commands. More...
 
class  CustomScriptRun
 Contains data for script runs where arguments are passed manually. More...
 
class  DataBlock
 Main DataBlock class. More...
 
class  DataBlock< DBlockT * >
 
class  DataBlockAll
 
struct  DataBlockConversionResolver
 
class  DataBlockConverter
 
class  DataBlockConverter< FromDataBlockType, std::string >
 
class  DataBlockConverter< FromDataBlockType, std::wstring >
 
struct  DataBlockNameResolver
 
struct  DataListener
 
struct  DataListenHolder
 
class  DataStore
 
class  DebugVariableNotifier
 
class  DelaunayTriangulator
 
class  DelayedTask
 Encapsulates a function that is ran after a time period. More...
 
class  Delegate
 An object which can accept BaseDelegateSlot derived callbacks that can be called when the event represented by this delegate is called. More...
 
class  EmptyVisitor
 Example visitor that does nothing, but doesn't crash either. More...
 
class  Engine
 The main class of the Leviathan Game Engine. More...
 
class  EntitySerializer
 Base class for all entity serializer classes. More...
 
class  Event
 Class that represents a statically defined event. More...
 
class  EventHandler
 Allows object to register for events that can be fired from anywhere. More...
 
class  Exception
 Base class for all exceptions thrown by Leviathan. More...
 
struct  FileDefinitionType
 
struct  FileDefSorter
 
class  FileSystem
 Class for indexing and searching game data directory. More...
 
class  FileTypeHolder
 File type. More...
 
struct  Float2
 
struct  Float3
 
struct  Float4
 
class  FpsCounter
 
class  GameConfiguration
 
class  GameModule
 Represents a scriptable part of a program. More...
 
class  GameSpecificPacketData
 Class that contains all data associated with a game specific packet. More...
 
class  GameSpecificPacketHandler
 Handles construction of all game specific packets. More...
 
class  GameWorld
 Represents a world that contains entities. More...
 
class  GameWorldFactory
 Allows overwriting the used GameWorld class in the engine. By default creates a StandardWorld. More...
 
class  GenericEvent
 Class that represents a dynamically defined event. More...
 
class  GeometryHelpers
 Helpers for generating procedural geometry. More...
 
class  GlobalCEFHandler
 Singleton class for handling CEF initialization that needs to be done right away. More...
 
class  Graphics
 
class  IDFactory
 
class  InputController
 
class  InputReceiver
 class to derive from when wanting to connect to input More...
 
class  InstanceCounter
 
struct  Int2
 
struct  Int3
 
struct  Int4
 
class  IntegerEventData
 Data for EVENT_TYPE_ENGINE_TICK and all others that have only int data. More...
 
class  InvalidAccess
 
class  InvalidArgument
 
class  InvalidState
 
class  InvalidType
 
class  IteratorAssignmentData
 
class  IteratorCharacterData
 
class  IteratorFindUntilData
 
class  IteratorNestingLevelData
 
class  IteratorNumberFindData
 
class  IteratorPositionData
 
class  IteratorUntilSequenceData
 
class  JavaScriptHelper
 Class that collects various JavaScript functions that would bloat other parts. More...
 
class  Key
 
class  KeyConfiguration
 Holds key configuration for an application. More...
 
class  LambdaDelegateSlot
 
class  LeapListener
 
class  LeapManager
 
class  LeviathanApplication
 Base class for all leviathan programs. More...
 
class  Locker
 
struct  LockTypeResolver
 
struct  LockTypeResolver< Mutex >
 
struct  LockTypeResolver< RecursiveMutex >
 
class  Logger
 Logger class for all text output. More...
 
class  ManualObject
 
class  MasterServer
 
class  MasterServerApplication
 
struct  MasterServerInformation
 
class  MD5
 
class  MMath
 
class  Model
 Entity has a model. More...
 
class  NamedVariableBlock
 DataBlock variant with name. More...
 
class  NamedVariableList
 hosts one or more VariableBlocks keeping only one name for all of them More...
 
class  NamedVars
 
class  NetworkAckField
 
class  NetworkCache
 Centralized variables that AI can use on clients to replicate server behavior. More...
 
class  NetworkClientInterface
 Class that encapsulates common networking functionality required by client programs. More...
 
class  NetworkHandler
 Handles everything related to connections. More...
 
class  NetworkInterface
 Class that encapsulates common networking functionality that is required by all networked programs. More...
 
class  NetworkMasterServerInterface
 Class that encapsulates common networking functionality required by server programs. More...
 
class  NetworkRequest
 
class  NetworkResponse
 
class  NetworkServerInterface
 Class that encapsulates common networking functionality required by server programs. More...
 
class  NewtonManager
 
class  NotFound
 
class  NULLPtr
 
class  ObjectFile
 
class  ObjectFileList
 Interface for object file lists to implement. More...
 
class  ObjectFileListProper
 Implementation of ObjectFileList. More...
 
class  ObjectFileObject
 Interface for object file objects to implement. More...
 
class  ObjectFileObjectProper
 Fully defined ObjectFileObject. More...
 
class  ObjectFileProcessor
 Static class for handling ObjectFiles. More...
 
class  ObjectFileTemplateDefinition
 Class that represents a template definition. More...
 
class  ObjectFileTemplateInstance
 Represents a template instantiation. More...
 
class  ObjectFileTemplateObject
 Class that represents an object created from a template. More...
 
class  ObjectFileTextBlock
 Interface for object file text blocks to implement. More...
 
class  ObjectFileTextBlockProper
 Implementation of ObjectFileTextBlock. More...
 
class  ObjectLoader
 Class to collect all entity creations to one class. More...
 
class  ObjectPool
 Creates objects in a shared memory region. More...
 
class  ObjectPoolTracked
 Creates objects in a shared memory region. More...
 
class  ObjectsComponentStates
 
class  OutOfMemoryHandler
 
class  PermissionsGroup
 
class  PermissionsManager
 
class  PermissionsNode
 
class  PermissionsPlayer
 
class  PhysicalMaterial
 
class  PhysicalWorld
 
class  Physics
 Entity has a physical component. More...
 
class  PhysicsComponentState
 State for Physics. More...
 
class  PhysicsMaterialManager
 
class  PhysicsStartEventData
 Data for EVENT_TYPE_PHYSICS_BEGIN. More...
 
struct  PhysMaterialDataPair
 
class  Plane
 Plane component. More...
 
class  Position
 Entity has position and direction it is looking at. More...
 
class  PositionComponentState
 State for Position without a Physics. More...
 
class  PositionStateSystem
 
struct  PotentiallySetIndex
 
class  ProceduralSoundData
 The main usable class for doing procedural audio. More...
 
class  QueuedTask
 Encapsulates a function that can later be ran in a free thread. More...
 
struct  QueuedTaskCheckValues
 Object passed to tasks which has common values. More...
 
class  Random
 Random number generator based on Mersenne Twister. More...
 
struct  RayCastData
 
class  RayCastHitEntity
 
class  RayTracing
 
class  Received
 Entity is received from a server. More...
 
class  ReceivedSystem
 Interpolates states for received objects and handles locally controlled entities. More...
 
class  ReferenceCounted
 
class  RemoteConsole
 Class used to handle remote server commands and receiving messages. More...
 
class  RemoteConsoleSession
 
class  RenderingPositionSystem
 Moves nodes of entities that have their positions changed. More...
 
class  RenderingStatistics
 Mainly a FPS limiter. More...
 
class  RenderNode
 Entity has an Ogre scene node. More...
 
class  RenderNodePropertiesSystem
 Handles properties of Ogre nodes that have a changed RenderNode. More...
 
class  RepeatCountedDelayedTask
 Encapsulates a function that is ran after a time period and repeated certain amount. More...
 
class  RepeatCountedTask
 Encapsulates a function that is ran certain amount of times. More...
 
class  RepeatingDelayedTask
 Encapsulates a function that is ran after a time period. More...
 
class  RequestCustom
 
class  RequestNone
 Empty request for ones that require no data. More...
 
class  ResourceFolderListener
 A file listener instance which listens for file changes in a folder. More...
 
class  ResourceRefreshHandler
 Allows various resource loaders to get notified when the file on disk changes. More...
 
class  ResponseCustom
 Used for BaseGameSpecificResponsePacket storing. More...
 
class  ResponseNone
 Empty keep alive response. More...
 
class  ScopeTimer
 
class  ScriptArgumentsProvider
 Classes implementing this interface allow script modules to run automatic OnInit and OnRelease function during release. More...
 
class  ScriptArgumentsProviderBridge
 Forms a connection between a ScriptModule and a ScriptArgumentsProvider which either can disconnect. More...
 
class  ScriptComponentHolder
 
class  ScriptConsole
 
class  ScriptExecutor
 Handles ScriptModule creation and AngelScript code execution. More...
 
class  ScriptLockHolder
 Allows scripts to create locks and easily convert them to LockPasser types. More...
 
class  ScriptLockPasser
 Class for Scripts to receive and pass on references to locks in native or script stacks. More...
 
class  ScriptModule
 
class  ScriptNotifiable
 BaseNotifiable for use in scripts. More...
 
class  ScriptNotifier
 BaseNotifier for use in scripts. More...
 
class  ScriptRunningSetup
 
struct  ScriptRunResult
 Holds a result of the new script run method. More...
 
struct  ScriptRunResult< void >
 
class  ScriptSafeVariableBlock
 Reference counted version for scripts of VariableBlock. More...
 
class  ScriptScript
 
struct  ScriptSourceFileData
 Represents a section of script source file. More...
 
struct  ScriptSystemUses
 Holds a single component type from c++ or from script, which a ScriptSystem uses. More...
 
class  ScriptSystemWrapper
 Wraps an AngelScript object that is an implementation of ScriptSystem. More...
 
class  Sendable
 Entity is sendable to clients. More...
 
class  SendableSystem
 Sends updated entities from server to clients. More...
 
struct  SentAcks
 Holds sent ack packets in order to mark the acks as properly sent. More...
 
class  SentNetworkThing
 Represents a sent packet and holds all kinds of data for it. More...
 
class  SentRequest
 Stores Requests while they are waiting for a response. More...
 
class  SentResponse
 Stores Responses that want confirmation that they have arrived. More...
 
class  ServerApplication
 
struct  SimpleAnimation
 Contains an nimation for Animated component. More...
 
class  SimpleDatabase
 
class  SingleSystem
 Base class for systems that use a single component directly. More...
 
class  SliderConstraint
 
class  SoundDevice
 Manages loading the audio library and provides some helpers. More...
 
struct  StartEndIndex
 
class  StateCreationSystem
 Base class for all systems that create states from changed components. More...
 
class  StateHelper
 
class  StateHolder
 Holds state objects of type for quick access by ObjectID. More...
 
class  StateInterpolator
 
class  StringClassDataIterator
 Iterator for string types. More...
 
class  StringClassPointerIterator
 Iterator that doesn't hold own copy of a string. More...
 
class  StringDataIterator
 
class  StringIterator
 Iterator class for getting parts of a string. More...
 
class  StringOperations
 Singleton class that has string processing functions. More...
 
class  SyncedPrimitive
 Template class for syncing basic types. More...
 
class  SyncedResource
 Base class for all values that are to be automatically synced between clients. More...
 
class  SyncedValue
 Class that encapsulates a value that can be used for syncing. More...
 
class  SyncedVariables
 Class that synchronizes some key variables with another instance. More...
 
class  System
 Base for all entity component related systems. More...
 
class  SystemCachedComponentCollectionStorage
 
class  TaskThread
 Object used by ThreadingManager to easily create properly initialized threads. More...
 
class  TextureGenerator
 
class  ThreadingManager
 Manages delayed execution of functions through use of QueuedTask and subclasses. More...
 
class  ThreadSafeGeneric
 Allows the inherited object to be locked. More...
 
class  ThreadSafeObjectPool
 Thread safe version of ObjectPool. More...
 
struct  ThreadSpecificData
 
class  Time
 
class  TimingMonitor
 
struct  TimingMonitorClock
 
struct  TvalToTypeResolver
 
struct  TypeToAngelScriptIDConverter
 
struct  TypeToAngelScriptTypeString
 Converts type to AngelScript type string. More...
 
class  UTF8DataIterator
 Unicode iterator for utf8 on top of string. More...
 
class  UTF8PointerDataIterator
 Raw pointer utf8 iterator. More...
 
struct  ValidListenerData
 some data that is stored when a listener is found More...
 
class  VariableBlock
 Non-template class for working with all types of DataBlocks. More...
 
class  Visitable
 Base class for all classes that accept visitors. More...
 
class  Visitor
 Base for all different visitors. More...
 
class  Window
 
struct  WindowDataDetails
 
class  WireData
 

Typedefs

typedef DataBlock< int > IntBlock
 
typedef DataBlock< float > FloatBlock
 
typedef DataBlock< bool > BoolBlock
 
typedef DataBlock< std::wstring > WstringBlock
 
typedef DataBlock< std::string > StringBlock
 
typedef DataBlock< char > CharBlock
 
typedef DataBlock< double > DoubleBlock
 
typedef DataBlock< void * > VoidPtrBlock
 
using Mutex = std::mutex
 
using RecursiveMutex = std::recursive_mutex
 
using Lock = std::unique_lock< std::mutex >
 
using RecursiveLock = std::lock_guard< std::recursive_mutex >
 
using ThreadSafe = ThreadSafeGeneric< Mutex >
 Simple lockable objects, no recursive locking. More...
 
using ThreadSafeRecursive = ThreadSafeGeneric< RecursiveMutex >
 Object supports recursive locking. More...
 
using ObjectID = int32_t
 
typedef Key< int32_t > GKey
 
using AccessFlags = uint32_t
 
typedef std::map< std::string, std::shared_ptr< VariableBlock > > SimpleDatabaseRowObject
 
typedef std::map< std::string, std::shared_ptr< std::vector< std::shared_ptr< SimpleDatabaseRowObject > > > > SimpleDatabaseObject
 

Enumerations

enum  COMPONENT_TYPE : uint16_t {
  COMPONENT_TYPE::Position, COMPONENT_TYPE::RenderNode, COMPONENT_TYPE::Sendable, COMPONENT_TYPE::Received,
  COMPONENT_TYPE::Physics, COMPONENT_TYPE::BoxGeometry, COMPONENT_TYPE::Model, COMPONENT_TYPE::ManualObject,
  COMPONENT_TYPE::Camera, COMPONENT_TYPE::Plane, COMPONENT_TYPE::Animated, COMPONENT_TYPE::Custom = 10000
}
 Must contain all valid Component types. More...
 
enum  ENTITY_CONSTRAINT_TYPE : uint16_t { ENTITY_CONSTRAINT_TYPE::Slider = 1, ENTITY_CONSTRAINT_TYPE::ControllerConstraint, ENTITY_CONSTRAINT_TYPE::Destructed, ENTITY_CONSTRAINT_TYPE::Custom = 1000 }
 Holds built-in types of constraints, used to identify types over the network. More...
 
enum  EVENT_TYPE {
  EVENT_TYPE_ERROR = 0, EVENT_TYPE_WAKEUP, EVENT_TYPE_GENERAL, EVENT_TYPE_KEYPRESS,
  EVENT_TYPE_KEYDOWN, EVENT_TYPE_SHOW, EVENT_TYPE_HIDE, EVENT_TYPE_TICK,
  EVENT_TYPE_REMOVE, EVENT_TYPE_EVENT_SEQUENCE_BEGIN, EVENT_TYPE_EVENT_SEQUENCE_END, EVENT_TYPE_MOUSEMOVED,
  EVENT_TYPE_MOUSEPOSITION, EVENT_TYPE_GUIDISABLE, EVENT_TYPE_GUIENABLE, EVENT_TYPE_RESIZE,
  EVENT_TYPE_WINDOW_RESIZE, EVENT_TYPE_ONCLICK, EVENT_TYPE_LISTENERVALUEUPDATED, EVENT_TYPE_FRAME_BEGIN,
  EVENT_TYPE_FRAME_END, EVENT_TYPE_INIT, EVENT_TYPE_RELEASE, EVENT_TYPE_PHYSICS_BEGIN,
  EVENT_TYPE_TEST, EVENT_TYPE_CLIENT_INTERPOLATION, EVENT_TYPE_ALL
}
 Engine events that are triggered at certain times. More...
 
enum  FILEGROUP {
  FILEGROUP_MODEL, FILEGROUP_TEXTURE, FILEGROUP_SOUND, FILEGROUP_SCRIPT,
  FILEGROUP_OTHER
}
 
enum  COMMANDSENDER_PERMISSIONMODE { COMMANDSENDER_PERMISSIONMODE_NORMAL, COMMANDSENDER_PERMISSIONMODE_IGNORE }
 
enum  QUOTETYPE { QUOTETYPE_DOUBLEQUOTES, QUOTETYPE_SINGLEQUOTES, QUOTETYPE_BOTH }
 
enum  DECIMALSEPARATORTYPE { DECIMALSEPARATORTYPE_DOT, DECIMALSEPARATORTYPE_COMMA, DECIMALSEPARATORTYPE_BOTH, DECIMALSEPARATORTYPE_NONE }
 
enum  UNNORMALCHARACTER {
  UNNORMALCHARACTER_TYPE_NON_ASCII = 0x1, UNNORMALCHARACTER_TYPE_CONTROLCHARACTERS = 0x2, UNNORMALCHARACTER_TYPE_WHITESPACE = 0x4, UNNORMALCHARACTER_TYPE_LOWCODES = 0x8,
  UNNORMALCHARACTER_TYPE_NON_NAMEVALID = 0x10, UNNORMALCHARACTER_TYPE_LINEEND = 0x20
}
 
enum  EQUALITYCHARACTER { EQUALITYCHARACTER_TYPE_EQUALITY, EQUALITYCHARACTER_TYPE_DOUBLEDOTSTYLE, EQUALITYCHARACTER_TYPE_ALL }
 
enum  ITERATORCALLBACK_RETURNTYPE { ITERATORCALLBACK_RETURNTYPE_STOP, ITERATORCALLBACK_RETURNTYPE_CONTINUE }
 
enum  SPECIAL_ITERATOR { SPECIAL_ITERATOR_ONNEWLINE_STOP = 0x4, SPECIAL_ITERATOR_HANDLECOMMENTS_ASSTRING = 0x10 }
 Special case handling flags for iterator. More...
 
enum  ITERATORFLAG_SET {
  ITERATORFLAG_SET_IGNORE_SPECIAL = 0x1, ITERATORFLAG_SET_STOP = 0x2, ITERATORFLAG_SET_INSIDE_STRING = 0x4, ITERATORFLAG_SET_INSIDE_STRING_DOUBLE = 0x8,
  ITERATORFLAG_SET_INSIDE_STRING_SINGLE = 0x10, ITERATORFLAG_SET_INSIDE_STRING_SINGLE_END = 0x20, ITERATORFLAG_SET_INSIDE_STRING_DOUBLE_END = 0x40, ITERATORFLAG_SET_IGNORE_SPECIAL_END = 0x80,
  ITERATORFLAG_SET_COMMENT_BEGINNING = 0x100, ITERATORFLAG_SET_INSIDE_COMMENT = 0x200, ITERATORFLAG_SET_INSIDE_CPPCOMMENT = 0x400, ITERATORFLAG_SET_INSIDE_CCOMMENT = 0x800,
  ITERATORFLAG_SET_CPPCOMMENT_END = 0x1000, ITERATORFLAG_SET_CCOMMENT_END = 0x2000
}
 Set flags for the iterator, this is changed to this for performance. More...
 
enum  NETWORKED_TYPE { NETWORKED_TYPE::Client, NETWORKED_TYPE::Server, NETWORKED_TYPE::Master, NETWORKED_TYPE::Error }
 Type of networked application. More...
 
enum  PACKET_TIMEOUT_STYLE : uint8_t { PACKET_TIMEOUT_STYLE::Unified }
 
enum  RECEIVE_GUARANTEE { RECEIVE_GUARANTEE::None, RECEIVE_GUARANTEE::ResendOnce, RECEIVE_GUARANTEE::Critical }
 Controls whether a packet is critical. More...
 
enum  CONNECTION_ENCRYPTION { CONNECTION_ENCRYPTION::Undecided, CONNECTION_ENCRYPTION::None, CONNECTION_ENCRYPTION::Standard }
 State of a connection's encryption. More...
 
enum  SERVER_JOIN_RESTRICT : uint8_t {
  SERVER_JOIN_RESTRICT::None, SERVER_JOIN_RESTRICT::Localhost, SERVER_JOIN_RESTRICT::LAN, SERVER_JOIN_RESTRICT::Whitelist,
  SERVER_JOIN_RESTRICT::Invite, SERVER_JOIN_RESTRICT::Friends, SERVER_JOIN_RESTRICT::Permissions, SERVER_JOIN_RESTRICT::Custom
}
 Allows servers to control who can join. More...
 
enum  SERVER_STATUS : uint8_t { SERVER_STATUS::Starting, SERVER_STATUS::Running, SERVER_STATUS::Shutdown, SERVER_STATUS::Restart }
 Allows servers to tell clients what they are doing. More...
 
enum  NETWORK_RESPONSE_INVALIDREASON : uint8_t {
  NETWORK_RESPONSE_INVALIDREASON::Unauthenticated, NETWORK_RESPONSE_INVALIDREASON::Unsupported, NETWORK_RESPONSE_INVALIDREASON::ServerFull, NETWORK_RESPONSE_INVALIDREASON::ServerNotAcceptingPlayers,
  NETWORK_RESPONSE_INVALIDREASON::NotAuthorized, NETWORK_RESPONSE_INVALIDREASON::ServerAlreadyConnectedToYou, NETWORK_RESPONSE_INVALIDREASON::ServerCustom
}
 Defines in what way a request was invalid can also define why a server disallowed a request. More...
 
enum  SERVER_ACCEPTED_TYPE : uint8_t { SERVER_ACCEPTED_TYPE::ConnectAccepted, SERVER_ACCEPTED_TYPE::RequestQueued }
 Defines what request the server accepted and any potential data. More...
 
enum  PING_FAIL_REASON { PING_FAIL_REASON::LossTooHigh, PING_FAIL_REASON::ConnectionClosed }
 If true 2 ack only packets are created each time one is sent. More...
 
enum  CONNECTION_RESTRICTION { CONNECTION_RESTRICTION::None, CONNECTION_RESTRICTION::ReceiveRemoteConsole }
 Allows restricting connections to allow only certain packets. More...
 
enum  CONNECTION_STATE {
  CONNECTION_STATE::NothingReceived, CONNECTION_STATE::Initial, CONNECTION_STATE::Connected, CONNECTION_STATE::Secured,
  CONNECTION_STATE::Authenticated, CONNECTION_STATE::Closed, CONNECTION_STATE::Punchthrough
}
 Main state of a connection. More...
 
enum  RECEIVED_STATE { RECEIVED_STATE::NotReceived = 0, RECEIVED_STATE::StateReceived, RECEIVED_STATE::AcksSent, RECEIVED_STATE::ReceivedAckSucceeded }
 For keeping track of received remote packets. More...
 
enum  NETWORK_REQUEST_TYPE : uint16_t {
  NETWORK_REQUEST_TYPE::Connect, NETWORK_REQUEST_TYPE::Security, NETWORK_REQUEST_TYPE::Authenticate, NETWORK_REQUEST_TYPE::Identification,
  NETWORK_REQUEST_TYPE::Serverstatus, NETWORK_REQUEST_TYPE::RemoteConsoleOpen, NETWORK_REQUEST_TYPE::RemoteConsoleAccess, NETWORK_REQUEST_TYPE::CloseRemoteConsole,
  NETWORK_REQUEST_TYPE::DoRemoteConsoleOpen, NETWORK_REQUEST_TYPE::JoinServer, NETWORK_REQUEST_TYPE::GetSingleSyncValue, NETWORK_REQUEST_TYPE::GetAllSyncValues,
  NETWORK_REQUEST_TYPE::RequestCommandExecution, NETWORK_REQUEST_TYPE::ConnectInput, NETWORK_REQUEST_TYPE::Echo, NETWORK_REQUEST_TYPE::WorldClockSync,
  NETWORK_REQUEST_TYPE::Custom
}
 
enum  NETWORK_RESPONSE_TYPE : uint16_t {
  NETWORK_RESPONSE_TYPE::Connect, NETWORK_RESPONSE_TYPE::Security, NETWORK_RESPONSE_TYPE::Authenticate, NETWORK_RESPONSE_TYPE::Identification,
  NETWORK_RESPONSE_TYPE::Keepalive, NETWORK_RESPONSE_TYPE::CloseConnection, NETWORK_RESPONSE_TYPE::RemoteConsoleClosed, NETWORK_RESPONSE_TYPE::RemoteConsoleOpened,
  NETWORK_RESPONSE_TYPE::InvalidRequest, NETWORK_RESPONSE_TYPE::ServerDisallow, NETWORK_RESPONSE_TYPE::ServerAllow, NETWORK_RESPONSE_TYPE::ServerStatus,
  NETWORK_RESPONSE_TYPE::SyncValData, NETWORK_RESPONSE_TYPE::SyncDataEnd, NETWORK_RESPONSE_TYPE::SyncResourceData, NETWORK_RESPONSE_TYPE::CreateNetworkedInput,
  NETWORK_RESPONSE_TYPE::UpdateNetworkedInput, NETWORK_RESPONSE_TYPE::DisconnectInput, NETWORK_RESPONSE_TYPE::EntityCreation, NETWORK_RESPONSE_TYPE::EntityUpdate,
  NETWORK_RESPONSE_TYPE::EntityDestruction, NETWORK_RESPONSE_TYPE::CacheUpdated, NETWORK_RESPONSE_TYPE::CacheRemoved, NETWORK_RESPONSE_TYPE::EntityConstraint,
  NETWORK_RESPONSE_TYPE::WorldFrozen, NETWORK_RESPONSE_TYPE::ServerHeartbeat, NETWORK_RESPONSE_TYPE::StartHeartbeats, NETWORK_RESPONSE_TYPE::Custom,
  NETWORK_RESPONSE_TYPE::None
}
 Defines the type of response that the packet contains. More...
 
enum  ScriptAccess : uint32_t { ScriptAccess::Nothing = 0x0, ScriptAccess::Builtin = 0x1, ScriptAccess::DefaultEngine = 0x2, ScriptAccess::FullFileSystem = 0x4 }
 
enum  CONSOLECOMMANDRESULTSTATE { CONSOLECOMMANDRESULTSTATE_SUCCEEDED, CONSOLECOMMANDRESULTSTATE_FAILED, CONSOLECOMMANDRESULTSTATE_WAITINGFORMORE }
 
enum  CONSOLECOMMANDTYPE {
  CONSOLECOMMANDTYPE_NONE, CONSOLECOMMANDTYPE_ADDVAR, CONSOLECOMMANDTYPE_ADDFUNC, CONSOLECOMMANDTYPE_DELVAR,
  CONSOLECOMMANDTYPE_DELFUNC, CONSOLECOMMANDTYPE_PRINTVAR, CONSOLECOMMANDTYPE_PRINTFUNC, CONSOLECOMMANDTYPE_ERROR
}
 
enum  SCRIPTBUILDSTATE {
  SCRIPTBUILDSTATE_EMPTY, SCRIPTBUILDSTATE_READYTOBUILD, SCRIPTBUILDSTATE_BUILT, SCRIPTBUILDSTATE_FAILED,
  SCRIPTBUILDSTATE_DISCARDED
}
 
enum  SCRIPT_RUNTYPE { SCRIPT_RUNTYPE_BREAKONERROR, SCRIPT_RUNTYPE_TRYTOCONTINUE }
 
enum  SCRIPT_RUN_RESULT { SCRIPT_RUN_RESULT::Success, SCRIPT_RUN_RESULT::Error, SCRIPT_RUN_RESULT::Suspended }
 

Functions

 DEFAULTTOANDFROMPACKETCONVERTFUNCTINS (IntBlock, int, int)
 
 DEFAULTTOANDFROMPACKETCONVERTFUNCTINS (FloatBlock, float, float)
 
 DEFAULTTOANDFROMPACKETCONVERTFUNCTINS (BoolBlock, bool, bool)
 
 DEFAULTTOANDFROMPACKETCONVERTFUNCTINS (WstringBlock, wstring, wstring)
 
 DEFAULTTOANDFROMPACKETCONVERTFUNCTINS (StringBlock, string, string)
 
 DEFAULTTOANDFROMPACKETCONVERTFUNCTINS (DoubleBlock, double, double)
 
 DEFAULTTOANDFROMPACKETCONVERTFUNCTINS (CharBlock, char, sf::Int8)
 
DLLEXPORT std::ostream & operator<< (std::ostream &stream, const VariableBlock &value)
 
 NAMERESOLVERTEMPLATEINSTANTIATION (int, DATABLOCK_TYPE_INT)
 
 NAMERESOLVERTEMPLATEINSTANTIATION (float, DATABLOCK_TYPE_FLOAT)
 
 NAMERESOLVERTEMPLATEINSTANTIATION (bool, DATABLOCK_TYPE_BOOL)
 
 NAMERESOLVERTEMPLATEINSTANTIATION (std::wstring, DATABLOCK_TYPE_WSTRING)
 
 NAMERESOLVERTEMPLATEINSTANTIATION (std::string, DATABLOCK_TYPE_STRING)
 
 NAMERESOLVERTEMPLATEINSTANTIATION (char, DATABLOCK_TYPE_CHAR)
 
 NAMERESOLVERTEMPLATEINSTANTIATION (double, DATABLOCK_TYPE_DOUBLE)
 
 NAMERESOLVERTEMPLATEINSTANTIATION (void *, DATABLOCK_TYPE_VOIDPTR)
 
 NAMERESOLVERTEMPLATEINSTANTIATION (void, DATABLOCK_TYPE_VOIDPTR)
 
 TVALRESOLVERTYPE (IntBlock, DATABLOCK_TYPE_INT)
 
 TVALRESOLVERTYPE (FloatBlock, DATABLOCK_TYPE_FLOAT)
 
 TVALRESOLVERTYPE (BoolBlock, DATABLOCK_TYPE_BOOL)
 
 TVALRESOLVERTYPE (WstringBlock, DATABLOCK_TYPE_WSTRING)
 
 TVALRESOLVERTYPE (StringBlock, DATABLOCK_TYPE_STRING)
 
 TVALRESOLVERTYPE (CharBlock, DATABLOCK_TYPE_CHAR)
 
 TVALRESOLVERTYPE (DoubleBlock, DATABLOCK_TYPE_DOUBLE)
 
 TVALRESOLVERTYPE (VoidPtrBlock, DATABLOCK_TYPE_VOIDPTR)
 
 CONVERSIONTEMPLATESPECIFICATIONFORDATABLOCK (IntBlock, int,(*block->Value))
 
 CONVERSIONTEMPLATESPECIFICATIONFORDATABLOCK (IntBlock, bool,(*block->Value) !=0)
 
 CONVERSIONTEMPLATESPECIFICATIONFORDATABLOCKDEFAULT (IntBlock, float)
 
 CONVERSIONTEMPLATESPECIFICATIONFORDATABLOCKDEFAULT (IntBlock, double)
 
 CONVERSIONTEMPLATESPECIFICATIONFORDATABLOCKDEFAULT (IntBlock, char)
 
 CONVERSIONTEMPLATESPECIFICATIONFORDATABLOCK (FloatBlock, float,(*block->Value))
 
 CONVERSIONTEMPLATESPECIFICATIONFORDATABLOCK (FloatBlock, bool,(*block->Value) !=0)
 
 CONVERSIONTEMPLATESPECIFICATIONFORDATABLOCKDEFAULT (FloatBlock, int)
 
 CONVERSIONTEMPLATESPECIFICATIONFORDATABLOCKDEFAULT (FloatBlock, double)
 
 CONVERSIONTEMPLATESPECIFICATIONFORDATABLOCKDEFAULT (FloatBlock, char)
 
 CONVERSIONTEMPLATESPECIFICATIONFORDATABLOCK (BoolBlock, bool,(*block->Value))
 
 CONVERSIONTEMPLATESPECIFICATIONFORDATABLOCKDEFAULT (BoolBlock, int)
 
 CONVERSIONTEMPLATESPECIFICATIONFORDATABLOCKDEFAULT (BoolBlock, double)
 
 CONVERSIONTEMPLATESPECIFICATIONFORDATABLOCKDEFAULT (BoolBlock, char)
 
 CONVERSIONTEMPLATESPECIFICATIONFORDATABLOCK (CharBlock, char,(*block->Value))
 
 CONVERSIONTEMPLATESPECIFICATIONFORDATABLOCK (CharBlock, bool,(*block->Value) !=0)
 
 CONVERSIONTEMPLATESPECIFICATIONFORDATABLOCKDEFAULT (CharBlock, int)
 
 CONVERSIONTEMPLATESPECIFICATIONFORDATABLOCKDEFAULT (CharBlock, double)
 
 CONVERSIONTEMPLATESPECIFICATIONFORDATABLOCKDEFAULT (CharBlock, float)
 
 CONVERSIONTEMPLATESPECIFICATIONFORDATABLOCK (DoubleBlock, double,(*block->Value))
 
 CONVERSIONTEMPLATESPECIFICATIONFORDATABLOCK (DoubleBlock, bool,(*block->Value) !=0)
 
 CONVERSIONTEMPLATESPECIFICATIONFORDATABLOCKDEFAULT (DoubleBlock, int)
 
 CONVERSIONTEMPLATESPECIFICATIONFORDATABLOCKDEFAULT (DoubleBlock, char)
 
 CONVERSIONTEMPLATESPECIFICATIONFORDATABLOCKDEFAULT (DoubleBlock, float)
 
 CONVERSIONTEMPLATESPECIFICATIONFORDATABLOCK (WstringBlock, std::wstring,(*block->Value))
 
 CONVERSIONTEMPLATESPECIFICATIONFORDATABLOCK (WstringBlock, std::string, Convert::Utf16ToUtf8(*block->Value))
 
 CONVERSIONTEMPLATESPECIFICATIONFORDATABLOCK (WstringBlock, bool, Convert::WstringFromBoolToInt(*block->Value) !=0)
 
 CONVERSIONTEMPLATESPECIFICATIONFORDATABLOCK (WstringBlock, float, Convert::WstringTo< float >(*block->Value))
 
 CONVERSIONTEMPLATESPECIFICATIONFORDATABLOCK (WstringBlock, double, Convert::WstringTo< double >(*block->Value))
 
 CONVERSIONTEMPLATESPECIFICATIONFORDATABLOCK (WstringBlock, char,(char) Convert::WstringTo< wchar_t >(*block->Value))
 
 CONVERSIONTEMPLATESPECIFICATIONFORDATABLOCK (WstringBlock, int, Convert::WstringTo< int >(*block->Value))
 
 CONVERSIONTEMPLATESPECIFICATIONFORDATABLOCK (StringBlock, std::string,(*block->Value))
 
 CONVERSIONTEMPLATESPECIFICATIONFORDATABLOCK (StringBlock, std::wstring, Convert::Utf8ToUtf16(*block->Value))
 
 CONVERSIONTEMPLATESPECIFICATIONFORDATABLOCK (StringBlock, bool, Convert::StringFromBoolToInt(*block->Value) !=0)
 
 CONVERSIONTEMPLATESPECIFICATIONFORDATABLOCK (StringBlock, float, Convert::StringTo< float >(*block->Value))
 
 CONVERSIONTEMPLATESPECIFICATIONFORDATABLOCK (StringBlock, double, Convert::StringTo< double >(*block->Value))
 
 CONVERSIONTEMPLATESPECIFICATIONFORDATABLOCK (StringBlock, char, Convert::StringTo< char >(*block->Value))
 
 CONVERSIONTEMPLATESPECIFICATIONFORDATABLOCK (StringBlock, int, Convert::StringTo< int >(*block->Value))
 
template<class InputIteratorT , class ResultInserterT >
void FindRemovedElements (const InputIteratorT &oldbegin, const InputIteratorT &oldend, const InputIteratorT &newbegin, const InputIteratorT &newend, ResultInserterT &addedresult, ResultInserterT &removedresult)
 
template<class InputCollectionT , class ResultInserterT >
void FindRemovedElements (const InputCollectionT &olditems, const InputCollectionT &newitems, ResultInserterT &addedresult, ResultInserterT &removedresult)
 
DLLEXPORT sf::Packet & operator<< (sf::Packet &packet, const Float3 &data)
 
DLLEXPORT sf::Packet & operator>> (sf::Packet &packet, Float3 &data)
 
DLLEXPORT sf::Packet & operator<< (sf::Packet &packet, const Float4 &data)
 
DLLEXPORT sf::Packet & operator>> (sf::Packet &packet, Float4 &data)
 
DLLEXPORT sf::Packet & operator<< (sf::Packet &packet, const NamedVariableList &data)
 
DLLEXPORT sf::Packet & operator>> (sf::Packet &packet, const NamedVariableList &data)
 
DLLEXPORT sf::Packet & operator<< (sf::Packet &packet, sf::Packet &packetinner)
 
DLLEXPORT sf::Packet & operator>> (sf::Packet &packet, sf::Packet &packetinner)
 
DLLEXPORT std::ostream & operator<< (std::ostream &stream, const Float4 &value)
 
DLLEXPORT std::ostream & operator<< (std::ostream &stream, const Float3 &value)
 
DLLEXPORT std::ostream & operator<< (std::ostream &stream, const Leviathan::Float2 &value)
 
DLLEXPORT std::ostream & operator<< (std::ostream &stream, const PotentiallySetIndex &value)
 
DLLEXPORT std::ostream & operator<< (std::ostream &stream, const StartEndIndex &value)
 
DLLEXPORT void ScriptSystemNodeHelper (GameWorld *world, void *cachedcomponents, int cachedtypeid, CScriptArray &systemcomponents)
 Helper for script systems to call to properly handle added and removed nodes. More...
 
void FFMPEGCallback (void *ptr, int level, const char *fmt, va_list varg)
 Custom callback for ffmpeg to pipe output to our logger class. More...
 
void RunGetResponseFromMaster (NetworkHandler *instance, std::shared_ptr< std::promise< std::string >> resultvar)
 
DLLEXPORT Ogre::Matrix4 NewtonMatrixToOgre (const dFloat *const matrix)
 
DLLEXPORT Ogre::Matrix4 PrepareOgreMatrixForNewton (const Ogre::Matrix4 &matrix)
 
DLLEXPORT Float3 ExtractNewtonMatrixTranslation (const float(&matrix)[16])
 Grabs the translation from a newton matrix without transposing. More...
 
int SingleBodyUpdate (const NewtonWorld *const newtonWorld, const void *islandHandle, int bodyCount)
 
bool operator== (const ScriptAccess &lhs, const AccessFlags &rhs)
 
bool operator== (const AccessFlags &lhs, const ScriptAccess &rhs)
 
DLLEXPORT AccessFlags ParseScriptAccess (std::string_view flagstring)
 Parses a string for access flags. More...
 
DLLEXPORT AccessFlags StringToScriptAccess (std::string_view str)
 Returns ScriptAccess matching string. More...
 
template<class From , class To >
To * DoReferenceCastDynamic (From *ptr)
 
template<class From , class To >
To * DoReferenceCastStatic (From *ptr)
 
template<class From , class To >
To * DoReferenceCastDynamicNoRef (From *ptr)
 
template<class From , class To >
To * DoReferenceCastStaticNoRef (From *ptr)
 
bool BindMathOperations (asIScriptEngine *engine)
 
bool BindStandardFunctions (asIScriptEngine *engine)
 Binds standard and other utilities like: std::min, std::max etc. More...
 
bool BindDataBlock (asIScriptEngine *engine)
 
bool BindNamedVars (asIScriptEngine *engine)
 
bool BindEvents (asIScriptEngine *engine)
 
bool BindRandom (asIScriptEngine *engine)
 
bool BindThreadingManager (asIScriptEngine *engine)
 
bool BindEngine (asIScriptEngine *engine)
 
bool BindApplication (asIScriptEngine *engine)
 
bool BindGameModule (asIScriptEngine *engine)
 
bool BindDelegates (asIScriptEngine *engine)
 
bool BindcAudio (asIScriptEngine *engine)
 
bool BindAudioSource (asIScriptEngine *engine)
 
bool BindSound (asIScriptEngine *engine)
 
bool BindFileSystem (asIScriptEngine *engine)
 
bool BindEngineCommon (asIScriptEngine *engine)
 
bool BindRayCast (asIScriptEngine *engine)
 
bool BindComponentTypeID (asIScriptEngine *engine, const char *name, uint16_t *value)
 Helper for BindComponentTypes. More...
 
bool BindComponentTypes (asIScriptEngine *engine)
 
bool BindScriptComponentTypeSupport (asIScriptEngine *engine)
 
bool BindEntity (asIScriptEngine *engine)
 
bool BindGUI (asIScriptEngine *engine)
 
bool BindNewtonTypes (asIScriptEngine *engine)
 
bool BindNewton (asIScriptEngine *engine)
 
bool BindOgreTypeDefs (asIScriptEngine *engine)
 
bool BindVector3 (asIScriptEngine *engine)
 
bool BindVector4 (asIScriptEngine *engine)
 
bool BindColour (asIScriptEngine *engine)
 
bool BindMatrix4 (asIScriptEngine *engine)
 
bool BindAnglesAndQuaternion (asIScriptEngine *engine)
 
bool BindScene (asIScriptEngine *engine)
 
bool BindSkeletons (asIScriptEngine *engine)
 
bool BindMeshes (asIScriptEngine *engine)
 
bool BindOgre (asIScriptEngine *engine)
 
template<class WorldType >
bool BindGameWorldBaseMethods (asIScriptEngine *engine, const char *classname)
 
template<class WorldType >
bool BindStandardWorldMethods (asIScriptEngine *engine, const char *classname)
 
bool BindFloat2 (asIScriptEngine *engine)
 
bool BindFloat3 (asIScriptEngine *engine)
 
bool BindFloat4 (asIScriptEngine *engine)
 
bool BindInt2 (asIScriptEngine *engine)
 
bool BindInt3 (asIScriptEngine *engine)
 
bool BindOgreConversions (asIScriptEngine *engine)
 
bool BindTypeDefs (asIScriptEngine *engine)
 
bool BindTypes (asIScriptEngine *engine)
 
bool PassParameterToCustomRun (std::unique_ptr< CustomScriptRun > &run, uint32_t value)
 
bool PassParameterToCustomRun (std::unique_ptr< CustomScriptRun > &run, void *value, int valuetypeid)
 Passes an object type that has already been resolved. More...
 
bool PassParameterToCustomRun (std::unique_ptr< CustomScriptRun > &run, asIScriptObject *value)
 Passes a script object type. More...
 
template<class T >
static constexpr bool IsTypeReferenceCounted ()
 Returns true of object type is reference counted. More...
 
template<class T >
static void IncrementRefCountIfRefCountedType (T *current)
 Increments refcount of obj if it is derived from ReferenceCounted or an angelscript type. More...
 
template<class T >
static void DecrementRefCountIfRefCountedType (T *current)
 Increments refcount of obj if it is derived from ReferenceCounted or an angelscript type. More...
 
template<class T >
static constexpr bool CanTypeRepresentAngelScriptTypes ()
 Returns true if type is an angelscript type that can represent different types of objects. More...
 
template<class T >
CScriptArray * ConvertVectorToASArray (const std::vector< T > &data, asIScriptEngine *engine, const char *arraytype=nullptr)
 Converts a std::vector to an AngelScript array. More...
 
template<class T >
CScriptArray * ConvertIteratorToASArray (T begin, T end, asIScriptEngine *engine, const char *arraytype=nullptr)
 Variant that converts from iterator range to an AngelScript array. More...
 
void ScriptMessageCallback (const asSMessageInfo *msg, void *param)
 
bool RegisterNotifiersWithAngelScript (asIScriptEngine *engine)
 
DLLEXPORT int ResolveProxy (const char *type, ScriptExecutor *resolver)
 
DLLEXPORT ScriptExecutorGetCurrentGlobalScriptExecutor ()
 Proxy for stuff that wants to only include this file. More...
 
 TYPE_RESOLVER_AS_PREDEFINED (int, "int")
 
 TYPE_RESOLVER_AS_PREDEFINED (unsigned int, "uint")
 
 TYPE_RESOLVER_AS_PREDEFINED (int64_t, "int64")
 
 TYPE_RESOLVER_AS_PREDEFINED (uint64_t, "uint64")
 
 TYPE_RESOLVER_AS_PREDEFINED (int16_t, "int16")
 
 TYPE_RESOLVER_AS_PREDEFINED (uint16_t, "uint16")
 
 TYPE_RESOLVER_AS_PREDEFINED (int8_t, "int8")
 
 TYPE_RESOLVER_AS_PREDEFINED (uint8_t, "uint8")
 
 TYPE_RESOLVER_AS_PREDEFINED (double, "double")
 
 TYPE_RESOLVER_AS_PREDEFINED (float, "float")
 
 TYPE_RESOLVER_AS_PREDEFINED (bool, "bool")
 
 TYPE_RESOLVER_AS_PREDEFINED (char, "int8")
 
 TYPE_RESOLVER_AS_PREDEFINED (std::string, "string")
 
 TYPE_RESOLVER_AS_PREDEFINED (Ogre::ColourValue, "Ogre::ColourValue@")
 
 TYPE_RESOLVER_AS_PREDEFINED (Ogre::Matrix4, "Ogre::Matrix4@")
 
 TYPE_RESOLVER_AS_PREDEFINED (Ogre::SceneNode, "Ogre::SceneNode@")
 
 TYPE_RESOLVER_AS_PREDEFINED (NewtonCollision, "NewtonCollision@")
 
void RunNewThread (TaskThread *thisthread)
 
DLLEXPORT void RegisterOgreOnThread ()
 
DLLEXPORT void UnregisterOgreOnThread ()
 
void RunTaskQueuerThread (ThreadingManager *manager)
 
void SetThreadName (TaskThread *thread, const std::string &name)
 

Variables

constexpr int32_t DOT_CHARACTER = '.'
 
constexpr int32_t UNIVERSAL_PATHSEPARATOR = '/'
 
constexpr int32_t WINDOWS_PATHSEPARATOR = '\\'
 
constexpr int32_t SPACE_CHARACTER = ' '
 
constexpr int32_t FIRST_NUMBER = '0'
 
constexpr int32_t LAST_NUMBER = '9'
 
constexpr int32_t DASH_CHARACTER = '-'
 
constexpr int32_t PLUS_SYMBOL = '+'
 
constexpr char WINDOWS_LINE_SEPARATOR [] = "\r\n"
 
constexpr char UNIVERSAL_LINE_SEPARATOR [] = "\n"
 
constexpr auto TICKSPEED = 50
 Number of milliseconds between engine and world ticks. More...
 
constexpr auto INTERPOLATION_TIME = 100
 
constexpr auto HEARTBEATS_MILLISECOND = 180
 
constexpr auto DEFAULT_MAXCONNECT_TRIES = 5
 
constexpr auto MAX_SERVERCOMMAND_LENGTH = 550
 
constexpr auto BASESENDABLE_STORED_RECEIVED_STATES = 6
 
constexpr auto PACKET_LOST_AFTER_MILLISECONDS = 1000
 
constexpr auto PACKET_LOST_AFTER_RECEIVED_NEWER = 4
 
constexpr auto CRITICAL_PACKET_MAX_TRIES = 8
 
constexpr float NORMALIZATION_TOLERANCE = 1e-6f
 For checking vector normalization. More...
 
constexpr auto MICROSECONDS_IN_SECOND = 1000000
 
constexpr float PI = 3.14159265f
 
constexpr float DEGREES_TO_RADIANS = PI/180.f
 
constexpr float RADIANS_TO_DEGREES = 180.f/PI
 
constexpr float EPSILON = 0.00000001f
 
constexpr ObjectID NULL_OBJECT = 0
 
constexpr auto DEFAULT_RENDER_QUEUE = 50
 
constexpr auto KEPT_STATES_COUNT = 5
 Number of states that are kept. Corresponds to time span of TICKSPEED * KEPT_STATES_COUNT. More...
 
static const std::map< std::string, EVENT_TYPEEventListenerNameToEventMap
 
static const std::map< std::string, EVENT_TYPEEventListenerCommonNameToEventMap
 
static std::string FFMPEGOutBuffer = ""
 This is for storing the ffmpeg output lines until a full line is outputted. More...
 
static Mutex FFMPEGOutBufferMutex
 
constexpr uint16_t LEVIATHAN_NORMAL_PACKET = 0x4C6E
 
constexpr uint16_t LEVIATHAN_ACK_PACKET = 0x4C61
 
constexpr uint8_t NORMAL_RESPONSE_TYPE = 0x12
 
constexpr uint8_t NORMAL_REQUEST_TYPE = 0x28
 
constexpr auto UNUSED_SHAPE_ID = 0
 
constexpr AccessFlags DefaultAccessFlags
 
static uint16_t PhysicsTYPEProxy = static_cast<uint16_t>(Physics::TYPE)
 
static uint16_t PositionTYPEProxy = static_cast<uint16_t>(Position::TYPE)
 
static uint16_t RenderNodeTYPEProxy = static_cast<uint16_t>(RenderNode::TYPE)
 
static uint16_t SendableTYPEProxy = static_cast<uint16_t>(Sendable::TYPE)
 
static uint16_t ReceivedTYPEProxy = static_cast<uint16_t>(Received::TYPE)
 
static uint16_t ModelTYPEProxy = static_cast<uint16_t>(Model::TYPE)
 
static uint16_t BoxGeometryTYPEProxy = static_cast<uint16_t>(BoxGeometry::TYPE)
 
static uint16_t CameraTYPEProxy = static_cast<uint16_t>(Camera::TYPE)
 
static uint16_t ManualObjectTYPEProxy = static_cast<uint16_t>(ManualObject::TYPE)
 
static uint16_t PlaneTYPEProxy = static_cast<uint16_t>(Plane::TYPE)
 
static uint16_t AnimatedTYPEProxy = static_cast<uint16_t>(Animated::TYPE)
 
constexpr auto ANGELSCRIPT_VOID_TYPEID = 0
 This has to be constant (and luckily so far it has been) More...
 
constexpr auto MOUSE_SCROLL_MULTIPLIER = 25.f
 The default CEF scroll speed is ridiculously slow so we multiply it with this. More...
 

Detailed Description

The access mask controls which registered functions and classes a script sees.

Typedef Documentation

◆ AccessFlags

using Leviathan::AccessFlags = typedef uint32_t

Definition at line 54 of file AccessMask.h.

◆ BoolBlock

Definition at line 384 of file DataBlock.h.

◆ CharBlock

Definition at line 387 of file DataBlock.h.

◆ DoubleBlock

Definition at line 388 of file DataBlock.h.

◆ FloatBlock

Definition at line 383 of file DataBlock.h.

◆ GKey

typedef Key<int32_t> Leviathan::GKey

Definition at line 223 of file Key.h.

◆ IntBlock

Definition at line 382 of file DataBlock.h.

◆ Lock

using Leviathan::Lock = typedef std::unique_lock<std::mutex>

Definition at line 15 of file ThreadSafe.h.

◆ Mutex

using Leviathan::Mutex = typedef std::mutex

Definition at line 13 of file ThreadSafe.h.

◆ ObjectID

using Leviathan::ObjectID = typedef int32_t

Definition at line 11 of file EntityCommon.h.

◆ RecursiveLock

using Leviathan::RecursiveLock = typedef std::lock_guard<std::recursive_mutex>

Definition at line 16 of file ThreadSafe.h.

◆ RecursiveMutex

using Leviathan::RecursiveMutex = typedef std::recursive_mutex

Definition at line 14 of file ThreadSafe.h.

◆ SimpleDatabaseObject

typedef std::map<std::string, std::shared_ptr<std::vector<std::shared_ptr<SimpleDatabaseRowObject> > > > Leviathan::SimpleDatabaseObject

Definition at line 13 of file SimpleDatabase.h.

◆ SimpleDatabaseRowObject

typedef std::map<std::string, std::shared_ptr<VariableBlock> > Leviathan::SimpleDatabaseRowObject

Definition at line 10 of file SimpleDatabase.h.

◆ StringBlock

typedef DataBlock<std::string> Leviathan::StringBlock

Definition at line 386 of file DataBlock.h.

◆ ThreadSafe

Simple lockable objects, no recursive locking.

Definition at line 131 of file ThreadSafe.h.

◆ ThreadSafeRecursive

Object supports recursive locking.

Less efficient than ThreadSafe

Definition at line 136 of file ThreadSafe.h.

◆ VoidPtrBlock

Definition at line 389 of file DataBlock.h.

◆ WstringBlock

typedef DataBlock<std::wstring> Leviathan::WstringBlock

Definition at line 385 of file DataBlock.h.

Enumeration Type Documentation

◆ COMMANDSENDER_PERMISSIONMODE

Enumerator
COMMANDSENDER_PERMISSIONMODE_NORMAL 
COMMANDSENDER_PERMISSIONMODE_IGNORE 

Definition at line 16 of file CommandHandler.h.

◆ COMPONENT_TYPE

enum Leviathan::COMPONENT_TYPE : uint16_t
strong

Must contain all valid Component types.

Enumerator
Position 
RenderNode 
Todo:
Hidden as serialized data
Sendable 
Received 
Physics 
BoxGeometry 
Model 
ManualObject 
Camera 
Plane 
Animated 
Custom 

All values above this are application specific types.

Definition at line 21 of file Component.h.

◆ CONNECTION_ENCRYPTION

State of a connection's encryption.

Enumerator
Undecided 

The connection has not reached Secured state.

None 

The connection doesn't need encryption Must be agreed on by both the server and the client. Otherwise a forced disconnect must occur

Standard 

Strong. Forced use of public keys for all secure messages.

The standard preferred encyption. With both ends knowing each other's public key + an agreed symmetric key (AES) for less secure messages

Definition at line 63 of file CommonNetwork.h.

63  {
64 
66  Undecided,
67 
71  None,
72 
75  Standard
76 
78  };
The connection has not reached Secured state.
In this mode the View doesn&#39;t take any input under any circumstances.
Strong. Forced use of public keys for all secure messages.

◆ CONNECTION_RESTRICTION

Allows restricting connections to allow only certain packets.

Enumerator
None 
ReceiveRemoteConsole 

Definition at line 59 of file Connection.h.

59  {
60  None,
62 };
In this mode the View doesn&#39;t take any input under any circumstances.

◆ CONNECTION_STATE

Main state of a connection.

Controls what packets can be received and also sending wrong ones will cause warning messages

Enumerator
NothingReceived 

This is active when just created the object. Moves to Punchthrough or Initial depending on whether a NAT is blocking the connection

Initial 

Begins the handshake with version number check.

Connected 

Moves to this state once handshake is complete.

Secured 

After a secure connection is set up, or if server tells client it isn't needed and client doesn't force secured

Authenticated 

Once the user has logged in and their unique ID has been verified At this point Player object should be created for the player. So that they can join a GameWorld

Closed 

Cannot receive anything. Caused by not receiving packets or an explicit close Will send a single close connection packet when moving to this state Invalidates Player object and forces a logout

Punchthrough 

When doing a NAT punch through, will move to Initial after this In this state 10 punch through packets will be sent separated by 100 ms

Definition at line 68 of file Connection.h.

◆ CONSOLECOMMANDRESULTSTATE

Enumerator
CONSOLECOMMANDRESULTSTATE_SUCCEEDED 
CONSOLECOMMANDRESULTSTATE_FAILED 
CONSOLECOMMANDRESULTSTATE_WAITINGFORMORE 

Definition at line 11 of file Console.h.

◆ CONSOLECOMMANDTYPE

Enumerator
CONSOLECOMMANDTYPE_NONE 
CONSOLECOMMANDTYPE_ADDVAR 
CONSOLECOMMANDTYPE_ADDFUNC 
CONSOLECOMMANDTYPE_DELVAR 
CONSOLECOMMANDTYPE_DELFUNC 
CONSOLECOMMANDTYPE_PRINTVAR 
CONSOLECOMMANDTYPE_PRINTFUNC 
CONSOLECOMMANDTYPE_ERROR 

Definition at line 17 of file Console.h.

◆ DECIMALSEPARATORTYPE

Enumerator
DECIMALSEPARATORTYPE_DOT 
DECIMALSEPARATORTYPE_COMMA 
DECIMALSEPARATORTYPE_BOTH 
DECIMALSEPARATORTYPE_NONE 

Definition at line 44 of file StringIterator.h.

◆ ENTITY_CONSTRAINT_TYPE

enum Leviathan::ENTITY_CONSTRAINT_TYPE : uint16_t
strong

Holds built-in types of constraints, used to identify types over the network.

Enumerator
Slider 

Type is SliderConstraint.

ControllerConstraint 

This type is used to connect entities to various controllers like TrackEntityController

Destructed 

Constraint has been destructed, used to not allow destruction multiple times

Custom 

Definition at line 12 of file Constraints.h.

12  : uint16_t
13  {
15  Slider = 1,
16 
17 
21 
22 
23 
26  Destructed,
27 
28  Custom = 1000
29  };
All values above this are application specific types.
unsigned short uint16_t
Definition: core.h:39

◆ EQUALITYCHARACTER

Enumerator
EQUALITYCHARACTER_TYPE_EQUALITY 
EQUALITYCHARACTER_TYPE_DOUBLEDOTSTYLE 
EQUALITYCHARACTER_TYPE_ALL 

Definition at line 60 of file StringIterator.h.

◆ EVENT_TYPE

Engine events that are triggered at certain times.

Enumerator
EVENT_TYPE_ERROR 
EVENT_TYPE_WAKEUP 
EVENT_TYPE_GENERAL 
EVENT_TYPE_KEYPRESS 
EVENT_TYPE_KEYDOWN 
EVENT_TYPE_SHOW 
EVENT_TYPE_HIDE 
EVENT_TYPE_TICK 
EVENT_TYPE_REMOVE 
EVENT_TYPE_EVENT_SEQUENCE_BEGIN 
EVENT_TYPE_EVENT_SEQUENCE_END 
EVENT_TYPE_MOUSEMOVED 
EVENT_TYPE_MOUSEPOSITION 
EVENT_TYPE_GUIDISABLE 
EVENT_TYPE_GUIENABLE 
EVENT_TYPE_RESIZE 
EVENT_TYPE_WINDOW_RESIZE 
EVENT_TYPE_ONCLICK 
EVENT_TYPE_LISTENERVALUEUPDATED 
EVENT_TYPE_FRAME_BEGIN 
EVENT_TYPE_FRAME_END 
EVENT_TYPE_INIT 
EVENT_TYPE_RELEASE 
EVENT_TYPE_PHYSICS_BEGIN 
EVENT_TYPE_TEST 
EVENT_TYPE_CLIENT_INTERPOLATION 

Only called on the client when a frame is about to be renderd and interpolation status needs to be determined

EVENT_TYPE_ALL 

Definition at line 13 of file Event.h.

13  {
14  EVENT_TYPE_ERROR = 0,
42 
44 };

◆ FILEGROUP

Enumerator
FILEGROUP_MODEL 
FILEGROUP_TEXTURE 
FILEGROUP_SOUND 
FILEGROUP_SCRIPT 
FILEGROUP_OTHER 

Definition at line 15 of file FileSystem.h.

◆ ITERATORCALLBACK_RETURNTYPE

Enumerator
ITERATORCALLBACK_RETURNTYPE_STOP 
ITERATORCALLBACK_RETURNTYPE_CONTINUE 

Definition at line 65 of file StringIterator.h.

◆ ITERATORFLAG_SET

Set flags for the iterator, this is changed to this for performance.

Enumerator
ITERATORFLAG_SET_IGNORE_SPECIAL 

\ is found, next special character will be ignored

ITERATORFLAG_SET_STOP 

The iterator has finished the current operation and will stop for now.

ITERATORFLAG_SET_INSIDE_STRING 

Iterator is currently inside a string.

ITERATORFLAG_SET_INSIDE_STRING_DOUBLE 

Iterator is currently inside double quoted string, "like this".

ITERATORFLAG_SET_INSIDE_STRING_SINGLE 

Iterator is currently inside single quoted string, 'like this'.

ITERATORFLAG_SET_INSIDE_STRING_SINGLE_END 

Iterator is currently on the closing ' character and the string might end after this character

ITERATORFLAG_SET_INSIDE_STRING_DOUBLE_END 

Iterator is currently on the closing " character and the string might end after this character

ITERATORFLAG_SET_IGNORE_SPECIAL_END 

Set when the next character is no longer affected by \, meaning this is always set when ITERATORFLAG_SET_IGNORE_SPECIAL is set

ITERATORFLAG_SET_COMMENT_BEGINNING 

Set when a comment is beginning. The iterator is currently on a / character which is followed by a / or *

ITERATORFLAG_SET_INSIDE_COMMENT 

Set when a comment is active, the iterator is on either the beginning // or /* or the ending

ITERATORFLAG_SET_INSIDE_CPPCOMMENT 

Set when inside a // comment.

ITERATORFLAG_SET_INSIDE_CCOMMENT 

Set when inside a /* comment.

ITERATORFLAG_SET_CPPCOMMENT_END 

Set when a c++ style comment will end on the next character.

ITERATORFLAG_SET_CCOMMENT_END 

Set when a c style comment will end on the next character.

Definition at line 84 of file StringIterator.h.

84  {
85 
88 
100 
104 
108 
123 };
Set when inside a /* comment.
\ is found, next special character will be ignored
The iterator has finished the current operation and will stop for now.
Set when a c style comment will end on the next character.
Iterator is currently inside double quoted string, "like this".
Set when a c++ style comment will end on the next character.
Iterator is currently inside a string.
Iterator is currently inside single quoted string, &#39;like this&#39;.

◆ NETWORK_REQUEST_TYPE

enum Leviathan::NETWORK_REQUEST_TYPE : uint16_t
strong
Enumerator
Connect 

Opening a connection.

Security 

Only one side of the connection can send this request, usually the client.

Authenticate 

Only the client may make this call, after this the Connection won't restrict any packets from being received

Identification 

This may be sent after CONNECTION_STATE::Connected has been reached "PongServer running version 0.5.1.0, status: 0/20"

Serverstatus 
RemoteConsoleOpen 
RemoteConsoleAccess 
CloseRemoteConsole 
DoRemoteConsoleOpen 

The receiving side is now allowed to open a remote console with the token.

JoinServer 

Client wants to join a server MasterServerToken The ID given by the master server

GetSingleSyncValue 
GetAllSyncValues 
RequestCommandExecution 

Used to request the server to run a command, used for chat and other things

Todo:
Implement if(Command.length() > MAX_SERVERCOMMAND_LENGTH)
ConnectInput 

Sent when a player requests the server to connect a NetworkedInput.

Echo 

Sent by servers to ping (time the time a client takes to respond) clients.

WorldClockSync 

Contains timing data to sync world clocks on a client Ticks The amount of ticks to set or change by Absolute Whether the tick count should be set to be the current or just added to the current tick

EngineMSTweak The engine tick tweaking, this should only be applied by a single GameWorld

Custom 

Used for game specific requests.

Definition at line 17 of file NetworkRequest.h.

17  : uint16_t{
18 
20  Connect,
21 
23  Security,
24 
28 
32 
34 
36 
38 
40 
43 
46  JoinServer,
47 
49 
51 
55 
58 
60  Echo,
61 
70 
72  Custom
73 };
Only one side of the connection can send this request, usually the client.
All values above this are application specific types.
Sent when a player requests the server to connect a NetworkedInput.
The receiving side is now allowed to open a remote console with the token.
unsigned short uint16_t
Definition: core.h:39
Sent by servers to ping (time the time a client takes to respond) clients.

◆ NETWORK_RESPONSE_INVALIDREASON

Defines in what way a request was invalid can also define why a server disallowed a request.

Enumerator
Unauthenticated 

Returned when the connection is anonymous (the other client hasn't requested verified connection)

Unsupported 

Returned when we don't implement the wanted action for example if we are asked our server status and we aren't a server

ServerFull 

Server has maximum number of players.

ServerNotAcceptingPlayers 

Server is not accepting players.

NotAuthorized 

The client isn't properly authenticated for that action or the server received mismatching security / id numbers

ServerAlreadyConnectedToYou 

The client has already connected to the server, and must disconnect before trying again.

ServerCustom 

The server has used a custom rule to disallow this.

Definition at line 105 of file CommonNetwork.h.

◆ NETWORK_RESPONSE_TYPE

enum Leviathan::NETWORK_RESPONSE_TYPE : uint16_t
strong

Defines the type of response that the packet contains.

Enumerator
Connect 

Sent in response to a NETWORK_REQUEST_TYPE::Connect.

Security 

Sent in response to a NETWORK_REQUEST_TYPE::Security

Todo:
Implemented packet breaking for this type
Authenticate 

Sent in response to a NETWORK_REQUEST_TYPE::Authenticate.

Identification 

Sent in response to a NETWORK_REQUEST_TYPE::Identification contains a user readable string, game name, game version and leviathan version strings

Keepalive 

Alias for None.

CloseConnection 

Immediately drops the connection when sent or received Uses class None

RemoteConsoleClosed 
RemoteConsoleOpened 
InvalidRequest 
ServerDisallow 

Sent by a server when it disallows a made request.

ServerAllow 

Sent by a server when a request is allowed.

ServerStatus 

Returns anonymous data about the server members: ServerNameString Contains the name of the server, should be limited to max 100 letters Joinable States if the server is joinable (has started, doesn't take slots into account)

JoinRestriction Defines the type of join authentication the server uses (restricts who can join)

Players Current human players on the server MaxPlayers Maximum human players Bots Current bots on the server ServerStatus The current status of the server. Used to define what the server is doing AdditionalFlags The flags of the server. These can be used based on the game for example to define game mode or level requirements or something else

SyncValData 

Sends a update/new SyncedValue.

SyncDataEnd 

Send after all SYNCVALDATA has been sent and indicates whether they should have arrived correctly

SyncResourceData 

Contains SyncedResource update notification.

CreateNetworkedInput 

Contains a new NetworkedInput.

UpdateNetworkedInput 

Contains control state updates regarding a NetworkedInput.

DisconnectInput 

Client sents this when they want input to be destroyed.

EntityCreation 

A new entity was created on the server.

EntityUpdate 

Contains update data for a single entity TickNumber The tick on which this was generated

ReferenceTick The tick number against which this update has been created Special case is -1 which notes that there is no reference tick

EntityDestruction 

Contains (list) an ID for entity to be deleted.

CacheUpdated 

Contains an updated cache variable.

CacheRemoved 

Contains the name of a removed cache variable.

EntityConstraint 

Instructs a world to create or destroy a constraint Create When false the constraint is to be deleted

WorldFrozen 

Sent when the server changes physics frozen state.

ServerHeartbeat 

A server heartbeat packet.

StartHeartbeats 

Marks that the client is required to send heartbeats.

Custom 

The packet is a game specific packet!

See also
GameSpecificPacketHandler BaseGameSpecificFactory BaseGameSpecificResponsePacket
None 

Empty response, used for keeping alive/nothing.

Definition at line 19 of file NetworkResponse.h.

19  : uint16_t {
20 
22  Connect,
23 
26  Security,
27 
30 
34 
36  Keepalive,
37 
41 
43 
45 
47 
50 
53 
70 
73 
77 
80 
83 
86 
89 
92 
99 
102 
104  CacheUpdated,
105 
107  CacheRemoved,
108 
112 
114  WorldFrozen,
115 
118 
121 
124  Custom,
125 
127  None
128 };
Only one side of the connection can send this request, usually the client.
All values above this are application specific types.
Contains an updated cache variable.
Sent by a server when a request is allowed.
Sends a update/new SyncedValue.
In this mode the View doesn&#39;t take any input under any circumstances.
Client sents this when they want input to be destroyed.
Sent when the server changes physics frozen state.
Contains (list) an ID for entity to be deleted.
unsigned short uint16_t
Definition: core.h:39
Contains the name of a removed cache variable.
Contains SyncedResource update notification.
Contains control state updates regarding a NetworkedInput.
Marks that the client is required to send heartbeats.
Sent by a server when it disallows a made request.
A new entity was created on the server.

◆ NETWORKED_TYPE

Type of networked application.

Enumerator
Client 
Server 
Master 
Error 

Only set when the derived class forgot to set it.

Definition at line 22 of file CommonNetwork.h.

◆ PACKET_TIMEOUT_STYLE

enum Leviathan::PACKET_TIMEOUT_STYLE : uint8_t
strong
Enumerator
Unified 

Loss is detected by packets received after and if a second has passed This makes all other styles deprecated

Definition at line 31 of file CommonNetwork.h.

31  : uint8_t {
32 
35  Unified
36 
39  //Timed,
40  //
43  //PacketsAfterReceived
44  };
unsigned char uint8_t
Definition: core.h:38

◆ PING_FAIL_REASON

If true 2 ack only packets are created each time one is sent.

Number of bytes that should be in each packet for it to be considered full Could probably be set to 1452 and still be fine on most connections But ipv4 promises that at least 512 byte payload should work The amount of received message numbers to keep in memory, these numbers are used to discard duplicates

This is required for ack only packets to work correctly (as they rely on getting a resend if the acks are lost) Fail reason for ConnectionInfo::CalculateNetworkPing

Enumerator
LossTooHigh 
ConnectionClosed 

Definition at line 52 of file Connection.h.

◆ QUOTETYPE

Enumerator
QUOTETYPE_DOUBLEQUOTES 
QUOTETYPE_SINGLEQUOTES 
QUOTETYPE_BOTH 

Definition at line 42 of file StringIterator.h.

◆ RECEIVE_GUARANTEE

Controls whether a packet is critical.

Enumerator
None 

Packet is sent once and if lost won't be resent.

ResendOnce 

Packet will get a single resend.

Critical 

Packet must be received within a certain time or the connection is considered broken. Will resend until connection is closed

Definition at line 49 of file CommonNetwork.h.

49  {
50 
52  None,
53 
55  ResendOnce,
56 
59  Critical
60  };
In this mode the View doesn&#39;t take any input under any circumstances.
Packet will get a single resend.

◆ RECEIVED_STATE

For keeping track of received remote packets.

These are used to populate ack fields for outgoing packets

Enumerator
NotReceived 

Packet hasn't been received.

StateReceived 

Packet is received but no acks have been sent.

AcksSent 

Packet is received and an ack has been sent This is basically the same as ReceivedAckSucceeded

ReceivedAckSucceeded 

Packet is received and the ack is also received At this point we no longer need to think about this packet

Definition at line 22 of file NetworkAckField.h.

22  {
23 
25  NotReceived = 0,
26 
29 
32  AcksSent,
33 
37 };
Packet is received but no acks have been sent.
Packet hasn&#39;t been received.

◆ SCRIPT_RUN_RESULT

Enumerator
Success 
Error 
Suspended 

Definition at line 14 of file ScriptRunningSetup.h.

◆ SCRIPT_RUNTYPE

◆ ScriptAccess

enum Leviathan::ScriptAccess : uint32_t
strong
Note
There is a maximum of 32 of different masks that can be defined
Enumerator
Nothing 

Can access none of the bound functions or "inbuilt" math and string types.

Builtin 

Access to the builtin types like string and math functions.

DefaultEngine 

Default mask for engine classes (some things are accessible even with this off)

FullFileSystem 

Definition at line 12 of file AccessMask.h.

12  : uint32_t{
13 
15  Nothing = 0x0,
16 
18  Builtin = 0x1,
19 
21  DefaultEngine = 0x2,
22  FullFileSystem = 0x4,
23  // 0x8
24  // 0x10
25  // 0x20
26  //0x40
27  //0x80 // first byte full
28  //0x100
29  //0x200
30  //0x400
31  //0x800
32  //0x1000
33  //0x2000
34  //0x4000
35  //0x8000 // second byte full (int range might stop here(
36  //0x10000
37  //0x20000
38  //0x40000
39  //0x80000
40  //0x100000
41  //0x200000
42  //0x400000
43  //0x800000 // third byte full
44  //0x1000000
45  //0x2000000
46  //0x4000000
47  //0x8000000
48  //0x10000000
49  //0x20000000
50  //0x40000000
51  //0x80000000 // fourth byte full. Last valid flag for angelscript
52 };
Access to the builtin types like string and math functions.
Can access none of the bound functions or "inbuilt" math and string types.
Default mask for engine classes (some things are accessible even with this off)
unsigned int uint32_t
Definition: core.h:40

◆ SCRIPTBUILDSTATE

Enumerator
SCRIPTBUILDSTATE_EMPTY 
SCRIPTBUILDSTATE_READYTOBUILD 
SCRIPTBUILDSTATE_BUILT 
SCRIPTBUILDSTATE_FAILED 
SCRIPTBUILDSTATE_DISCARDED 

Only set when the module can no longer be retrieved, and the whole ScriptModule needs to be recreated

Definition at line 20 of file ScriptModule.h.

◆ SERVER_ACCEPTED_TYPE

enum Leviathan::SERVER_ACCEPTED_TYPE : uint8_t
strong

Defines what request the server accepted and any potential data.

Enumerator
ConnectAccepted 

Server has accepted your join request.

RequestQueued 

Server has accepted the request and will handle it soon.

Definition at line 133 of file CommonNetwork.h.

133  : uint8_t{
134 
137 
140  };
Server has accepted the request and will handle it soon.
unsigned char uint8_t
Definition: core.h:38
Server has accepted your join request.

◆ SERVER_JOIN_RESTRICT

enum Leviathan::SERVER_JOIN_RESTRICT : uint8_t
strong

Allows servers to control who can join.

Enumerator
None 

Everyone can join the server.

Localhost 
LAN 
Todo:
A proper lan detection
Whitelist 
Invite 
Friends 
Permissions 
Custom 

Definition at line 81 of file CommonNetwork.h.

◆ SERVER_STATUS

enum Leviathan::SERVER_STATUS : uint8_t
strong

Allows servers to tell clients what they are doing.

Enumerator
Starting 
Running 
Shutdown 
Restart 

Definition at line 96 of file CommonNetwork.h.

◆ SPECIAL_ITERATOR

Special case handling flags for iterator.

Enumerator
SPECIAL_ITERATOR_ONNEWLINE_STOP 
SPECIAL_ITERATOR_HANDLECOMMENTS_ASSTRING 

Causes comments to be handled as whitespace/delimiting.

Definition at line 71 of file StringIterator.h.

71  {
72 
74  //SPECIAL_ITERATOR_ONNEWLINE_WHITESPACE = 0x8,
77 };
Causes comments to be handled as whitespace/delimiting.

◆ UNNORMALCHARACTER

Enumerator
UNNORMALCHARACTER_TYPE_NON_ASCII 
UNNORMALCHARACTER_TYPE_CONTROLCHARACTERS 
UNNORMALCHARACTER_TYPE_WHITESPACE 
UNNORMALCHARACTER_TYPE_LOWCODES 
UNNORMALCHARACTER_TYPE_NON_NAMEVALID 
UNNORMALCHARACTER_TYPE_LINEEND 

Definition at line 51 of file StringIterator.h.

Function Documentation

◆ BindAnglesAndQuaternion()

bool Leviathan::BindAnglesAndQuaternion ( asIScriptEngine *  engine)

Definition at line 349 of file OgreBind.cpp.

350 {
351 
352  if(engine->RegisterObjectType("Radian", sizeof(Ogre::Radian),
353  asOBJ_VALUE | asGetTypeTraits<Ogre::Radian>() | asOBJ_POD |
354  asOBJ_APP_CLASS_ALLFLOATS) < 0) {
356  }
357 
358  if(engine->RegisterObjectType("Degree", sizeof(Ogre::Degree),
359  asOBJ_VALUE | asGetTypeTraits<Ogre::Degree>() | asOBJ_POD |
360  asOBJ_APP_CLASS_ALLFLOATS) < 0) {
362  }
363 
364  if(engine->RegisterObjectType("Quaternion", sizeof(Ogre::Quaternion),
365  asOBJ_VALUE | asGetTypeTraits<Ogre::Quaternion>() | asOBJ_POD |
366  asOBJ_APP_CLASS_ALLFLOATS) < 0) {
368  }
369 
370  if(engine->RegisterObjectMethod("Quaternion", "Vector3 xAxis() const",
371  asMETHOD(Ogre::Quaternion, xAxis), asCALL_THISCALL) < 0) {
373  }
374 
375  if(engine->RegisterObjectMethod("Quaternion", "Vector3 yAxis() const",
376  asMETHOD(Ogre::Quaternion, yAxis), asCALL_THISCALL) < 0) {
378  }
379 
380  if(engine->RegisterObjectMethod("Quaternion", "Vector3 zAxis() const",
381  asMETHOD(Ogre::Quaternion, zAxis), asCALL_THISCALL) < 0) {
383  }
384 
385  if(engine->RegisterObjectMethod("Quaternion", "Quaternion Inverse() const",
386  asMETHOD(Ogre::Quaternion, Inverse), asCALL_THISCALL) < 0) {
388  }
389 
390  if(engine->RegisterObjectMethod("Quaternion", "Vector3 opMul(const Vector3 &in vec) const",
391  asMETHODPR(Ogre::Quaternion, operator*,(const Ogre::Vector3&) const, Ogre::Vector3),
392  asCALL_THISCALL) < 0) {
394  }
395 
396  // Alias to the above function
397  if(engine->RegisterObjectMethod("Quaternion",
398  "Vector3 RotateVector(const Vector3 &in vec) const",
399  asMETHODPR(Ogre::Quaternion, operator*,(const Ogre::Vector3&) const, Ogre::Vector3),
400  asCALL_THISCALL) < 0) {
402  }
403 
404  if(engine->SetDefaultNamespace("Ogre::Quaternion") < 0) {
406  }
407 
408  if(engine->RegisterGlobalProperty("const Ogre::Quaternion IDENTITY",
409  const_cast<Ogre::Quaternion*>(&Ogre::Quaternion::IDENTITY)) < 0) {
411  }
412 
413  if(engine->SetDefaultNamespace("Ogre") < 0) {
415  }
416 
417  // ------------------------------------ //
418 
419  if(engine->RegisterObjectBehaviour("Radian", asBEHAVE_CONSTRUCT, "void f(float radians)",
420  asFUNCTION(RadianProxy), asCALL_CDECL_OBJFIRST) < 0) {
422  }
423 
424  if(engine->RegisterObjectBehaviour("Radian", asBEHAVE_CONSTRUCT,
425  "void f(const Degree &in degree)", asFUNCTION(RadianProxyDegree),
426  asCALL_CDECL_OBJFIRST) < 0) {
428  }
429 
430  if(engine->RegisterObjectBehaviour("Degree", asBEHAVE_CONSTRUCT, "void f(float degrees)",
431  asFUNCTION(DegreeProxy), asCALL_CDECL_OBJFIRST) < 0) {
433  }
434 
435  if(engine->RegisterObjectBehaviour("Degree", asBEHAVE_CONSTRUCT,
436  "void f(const Radian &in radian)", asFUNCTION(DegreeProxyRadian),
437  asCALL_CDECL_OBJFIRST) < 0) {
439  }
440 
441  if(engine->RegisterObjectMethod("Radian", "Degree opImplConv() const",
442  asFUNCTION(RadianToDegreeCast), asCALL_CDECL_OBJFIRST) < 0) {
444  }
445 
446  if(engine->RegisterObjectMethod("Radian", "Real valueDegrees() const",
447  asMETHOD(Ogre::Radian, valueDegrees), asCALL_THISCALL) < 0) {
449  }
450 
451  if(engine->RegisterObjectMethod("Radian", "Real valueRadians() const",
452  asMETHOD(Ogre::Radian, valueRadians), asCALL_THISCALL) < 0) {
454  }
455 
456  if(engine->RegisterObjectMethod("Radian", "Real valueAngleUnits() const",
457  asMETHOD(Ogre::Radian, valueAngleUnits), asCALL_THISCALL) < 0) {
459  }
460 
461  if(engine->RegisterObjectMethod("Degree", "Radian opImplConv() const",
462  asFUNCTION(DegreeToRadianCast), asCALL_CDECL_OBJFIRST) < 0) {
464  }
465 
466  if(engine->RegisterObjectMethod("Degree", "Real valueDegrees() const",
467  asMETHOD(Ogre::Degree, valueDegrees), asCALL_THISCALL) < 0) {
469  }
470 
471  if(engine->RegisterObjectMethod("Degree", "Real valueRadians() const",
472  asMETHOD(Ogre::Degree, valueRadians), asCALL_THISCALL) < 0) {
474  }
475 
476  if(engine->RegisterObjectMethod("Degree", "Real valueAngleUnits() const",
477  asMETHOD(Ogre::Degree, valueAngleUnits), asCALL_THISCALL) < 0) {
479  }
480 
481  if(engine->RegisterObjectBehaviour("Quaternion", asBEHAVE_CONSTRUCT,
482  "void f(const Radian &in radian, const Vector3 &in vector)",
483  asFUNCTION(QuaternionProxyAroundAxis), asCALL_CDECL_OBJFIRST) < 0) {
485  }
486 
487  return true;
488 }
void RadianProxyDegree(void *memory, const Ogre::Degree &degree)
Definition: OgreBind.cpp:64
void QuaternionProxyAroundAxis(void *memory, const Ogre::Radian &radian, const Ogre::Vector3 &vector)
Definition: OgreBind.cpp:74
void DegreeProxy(void *memory, Ogre::Real degree)
Definition: OgreBind.cpp:44
Ogre::Radian DegreeToRadianCast(Ogre::Degree *self)
Definition: OgreBind.cpp:54
void DegreeProxyRadian(void *memory, const Ogre::Radian &radian)
Definition: OgreBind.cpp:49
#define ANGELSCRIPT_REGISTERFAIL
Definition: BindHelpers.h:10
Ogre::Degree RadianToDegreeCast(Ogre::Radian *self)
Definition: OgreBind.cpp:69
void RadianProxy(void *memory, Ogre::Real radian)
Definition: OgreBind.cpp:59

◆ BindApplication()

bool Leviathan::BindApplication ( asIScriptEngine *  engine)

Definition at line 588 of file CommonEngineBind.cpp.

589 {
590 
591  if(engine->RegisterEnum("NETWORKED_TYPE") < 0) {
593  }
594 
599 
600  if(engine->RegisterObjectType("LeviathanApplication", 0, asOBJ_REF | asOBJ_NOCOUNT) < 0) {
602  }
603 
604  // Global get function //
605  if(engine->RegisterGlobalFunction("LeviathanApplication& GetLeviathanApplication()",
606  asFUNCTION(LeviathanApplication::Get), asCALL_CDECL) < 0) {
608  }
609 
610  if(engine->RegisterObjectMethod("LeviathanApplication", "void MarkAsClosing()",
611  asMETHOD(LeviathanApplication, MarkAsClosing), asCALL_THISCALL) < 0) {
613  }
614 
615  if(engine->RegisterObjectMethod("LeviathanApplication", "bool Quitting()",
616  asMETHOD(LeviathanApplication, Quitting), asCALL_THISCALL) < 0) {
618  }
619 
620  if(engine->RegisterObjectMethod("LeviathanApplication",
621  "NETWORKED_TYPE GetProgramNetType() const",
622  asMETHOD(LeviathanApplication, GetProgramNetType), asCALL_THISCALL) < 0) {
624  }
625 
626  return true;
627 }
#define ANGELSCRIPT_REGISTER_ENUM_VALUE(enum, x)
Definition: BindHelpers.h:105
NETWORKED_TYPE
Type of networked application.
Definition: CommonNetwork.h:22
#define ANGELSCRIPT_REGISTERFAIL
Definition: BindHelpers.h:10
Base class for all leviathan programs.
Definition: Application.h:16

◆ BindAudioSource()

bool Leviathan::BindAudioSource ( asIScriptEngine *  engine)

Definition at line 932 of file CommonEngineBind.cpp.

933 {
935 
936  if(engine->RegisterObjectMethod("AudioSource", "bool Play2D()",
937  asMETHOD(AudioSource, Play2D), asCALL_THISCALL) < 0) {
939  }
940 
941  if(engine->RegisterObjectMethod(
942  "AudioSource", "void Stop()", asMETHOD(AudioSource, Play2D), asCALL_THISCALL) < 0) {
944  }
945 
946  if(engine->RegisterObjectMethod("AudioSource", "bool IsPlaying() const",
947  asMETHOD(AudioSource, IsPlaying), asCALL_THISCALL) < 0) {
949  }
950 
951  if(engine->RegisterObjectMethod("AudioSource", "cAudio::IAudioSource& Get()",
952  asMETHOD(AudioSource, Get), asCALL_THISCALL) < 0) {
954  }
955 
956  return true;
957 }
#define ANGELSCRIPT_REGISTER_REF_TYPE(RegisterName, ClassName)
Definition: BindHelpers.h:90
#define ANGELSCRIPT_REGISTERFAIL
Definition: BindHelpers.h:10
Small ReferenceCounted wrapper around a sound stream.
Definition: AudioSource.h:20

◆ BindcAudio()

bool Leviathan::BindcAudio ( asIScriptEngine *  engine)

Definition at line 668 of file CommonEngineBind.cpp.

669 {
670  if(engine->SetDefaultNamespace("cAudio") < 0) {
672  }
673 
674  if(engine->RegisterObjectType("IAudioSource", 0, asOBJ_REF | asOBJ_NOHANDLE) < 0) {
676  }
677 
678 
679  if(engine->RegisterObjectMethod("IAudioSource", "bool play()",
680  asMETHOD(cAudio::IAudioSource, play), asCALL_THISCALL) < 0) {
682  }
683 
684  if(engine->RegisterObjectMethod("IAudioSource", "bool play2d(const bool &in toLoop)",
685  asMETHOD(cAudio::IAudioSource, play2d), asCALL_THISCALL) < 0) {
687  }
688 
689  // bool play3d(const cVector3& position, const float& soundstr = 1.0, const bool& toLoop =
690  // false) = 0;
691 
692  if(engine->RegisterObjectMethod("IAudioSource", "bool pause()",
693  asMETHOD(cAudio::IAudioSource, pause), asCALL_THISCALL) < 0) {
695  }
696 
697  if(engine->RegisterObjectMethod("IAudioSource", "void stop()",
698  asMETHOD(cAudio::IAudioSource, stop), asCALL_THISCALL) < 0) {
700  }
701 
702  if(engine->RegisterObjectMethod("IAudioSource", "void loop(const bool &in toLoop)",
703  asMETHOD(cAudio::IAudioSource, loop), asCALL_THISCALL) < 0) {
705  }
706 
707  if(engine->RegisterObjectMethod("IAudioSource",
708  "bool seek(const float &in seconds, bool relative = false)",
709  asMETHOD(cAudio::IAudioSource, seek), asCALL_THISCALL) < 0) {
711  }
712 
713  if(engine->RegisterObjectMethod("IAudioSource", "float getTotalAudioTime()",
714  asMETHOD(cAudio::IAudioSource, getTotalAudioTime), asCALL_THISCALL) < 0) {
716  }
717 
718  if(engine->RegisterObjectMethod("IAudioSource", "int getTotalAudioSize()",
719  asMETHOD(cAudio::IAudioSource, getTotalAudioSize), asCALL_THISCALL) < 0) {
721  }
722 
723  if(engine->RegisterObjectMethod("IAudioSource", "int getCompressedAudioSize()",
724  asMETHOD(cAudio::IAudioSource, getCompressedAudioSize), asCALL_THISCALL) < 0) {
726  }
727 
728  if(engine->RegisterObjectMethod("IAudioSource", "float getCurrentAudioTime()",
729  asMETHOD(cAudio::IAudioSource, getCurrentAudioTime), asCALL_THISCALL) < 0) {
731  }
732 
733  if(engine->RegisterObjectMethod("IAudioSource", "int getCurrentAudioPosition()",
734  asMETHOD(cAudio::IAudioSource, getCurrentAudioPosition), asCALL_THISCALL) < 0) {
736  }
737 
738  if(engine->RegisterObjectMethod("IAudioSource", "int getCurrentCompressedAudioPosition()",
739  asMETHOD(cAudio::IAudioSource, getCurrentCompressedAudioPosition),
740  asCALL_THISCALL) < 0) {
742  }
743 
744  if(engine->RegisterObjectMethod("IAudioSource", "bool isValid() const",
745  asMETHOD(cAudio::IAudioSource, isValid), asCALL_THISCALL) < 0) {
747  }
748 
749  if(engine->RegisterObjectMethod("IAudioSource", "bool isPlaying() const",
750  asMETHOD(cAudio::IAudioSource, isPlaying), asCALL_THISCALL) < 0) {
752  }
753 
754  if(engine->RegisterObjectMethod("IAudioSource", "bool isPaused() const",
755  asMETHOD(cAudio::IAudioSource, isPaused), asCALL_THISCALL) < 0) {
757  }
758 
759  if(engine->RegisterObjectMethod("IAudioSource", "bool isStopped() const",
760  asMETHOD(cAudio::IAudioSource, isStopped), asCALL_THISCALL) < 0) {
762  }
763 
764  if(engine->RegisterObjectMethod("IAudioSource", "bool isLooping() const",
765  asMETHOD(cAudio::IAudioSource, isLooping), asCALL_THISCALL) < 0) {
767  }
768 
769  // void setPosition(const cVector3& position) = 0;
770 
771  // void setVelocity(const cVector3& velocity) = 0;
772 
773  // void setDirection(const cVector3& direction) = 0;
774 
775  if(engine->RegisterObjectMethod("IAudioSource",
776  "void setRolloffFactor(const float &in rolloff)",
777  asMETHOD(cAudio::IAudioSource, setRolloffFactor), asCALL_THISCALL) < 0) {
779  }
780 
781  if(engine->RegisterObjectMethod("IAudioSource",
782  "void setStrength(const float &in soundstrength)",
783  asMETHOD(cAudio::IAudioSource, setStrength), asCALL_THISCALL) < 0) {
785  }
786 
787  if(engine->RegisterObjectMethod("IAudioSource",
788  "void setMinDistance(const float &in minDistance)",
789  asMETHOD(cAudio::IAudioSource, setMinDistance), asCALL_THISCALL) < 0) {
791  }
792 
793  if(engine->RegisterObjectMethod("IAudioSource",
794  "void setMaxAttenuationDistance(const float &in maxDistance)",
795  asMETHOD(cAudio::IAudioSource, setMaxAttenuationDistance), asCALL_THISCALL) < 0) {
797  }
798 
799  if(engine->RegisterObjectMethod("IAudioSource", "void setPitch(const float &in pitch)",
800  asMETHOD(cAudio::IAudioSource, setPitch), asCALL_THISCALL) < 0) {
802  }
803 
804  if(engine->RegisterObjectMethod("IAudioSource", "void setVolume(const float &in volume)",
805  asMETHOD(cAudio::IAudioSource, setVolume), asCALL_THISCALL) < 0) {
807  }
808 
809  if(engine->RegisterObjectMethod("IAudioSource",
810  "void setMinVolume(const float &in minVolume)",
811  asMETHOD(cAudio::IAudioSource, setMinVolume), asCALL_THISCALL) < 0) {
813  }
814 
815  if(engine->RegisterObjectMethod("IAudioSource",
816  "void setMaxVolume(const float &in maxVolume)",
817  asMETHOD(cAudio::IAudioSource, setMaxVolume), asCALL_THISCALL) < 0) {
819  }
820 
821  if(engine->RegisterObjectMethod("IAudioSource",
822  "void setInnerConeAngle(const float &in innerAngle)",
823  asMETHOD(cAudio::IAudioSource, setInnerConeAngle), asCALL_THISCALL) < 0) {
825  }
826 
827  if(engine->RegisterObjectMethod("IAudioSource",
828  "void setOuterConeAngle(const float &in outerAngle)",
829  asMETHOD(cAudio::IAudioSource, setOuterConeAngle), asCALL_THISCALL) < 0) {
831  }
832 
833  if(engine->RegisterObjectMethod("IAudioSource",
834  "void setOuterConeVolume(const float &in outerVolume)",
835  asMETHOD(cAudio::IAudioSource, setOuterConeVolume), asCALL_THISCALL) < 0) {
837  }
838 
839  if(engine->RegisterObjectMethod("IAudioSource",
840  "void setDopplerStrength(const float &in dstrength)",
841  asMETHOD(cAudio::IAudioSource, setDopplerStrength), asCALL_THISCALL) < 0) {
843  }
844 
845 
846  // void setDopplerVelocity(const cVector3& dvelocity) = 0;
847 
848  // void move(const cVector3& position) = 0;
849  // cVector3 getPosition() const = 0;
850  // cVector3 getVelocity() const = 0;
851  // cVector3 getDirection() const = 0;
852 
853  if(engine->RegisterObjectMethod("IAudioSource", "bool isRelative() const",
854  asMETHOD(cAudio::IAudioSource, isRelative), asCALL_THISCALL) < 0) {
856  }
857 
858  if(engine->RegisterObjectMethod("IAudioSource", "float getRolloffFactor() const",
859  asMETHOD(cAudio::IAudioSource, getRolloffFactor), asCALL_THISCALL) < 0) {
861  }
862 
863  if(engine->RegisterObjectMethod("IAudioSource", "float getStrength() const",
864  asMETHOD(cAudio::IAudioSource, getStrength), asCALL_THISCALL) < 0) {
866  }
867 
868  if(engine->RegisterObjectMethod("IAudioSource", "float getMinDistance() const",
869  asMETHOD(cAudio::IAudioSource, getMinDistance), asCALL_THISCALL) < 0) {
871  }
872 
873  if(engine->RegisterObjectMethod("IAudioSource", "float getMaxDistance() const",
874  asMETHOD(cAudio::IAudioSource, getMaxDistance), asCALL_THISCALL) < 0) {
876  }
877 
878  if(engine->RegisterObjectMethod("IAudioSource", "float calculateGain() const",
879  asMETHOD(cAudio::IAudioSource, calculateGain), asCALL_THISCALL) < 0) {
881  }
882 
883  if(engine->RegisterObjectMethod("IAudioSource", "float getPitch() const",
884  asMETHOD(cAudio::IAudioSource, getPitch), asCALL_THISCALL) < 0) {
886  }
887 
888  if(engine->RegisterObjectMethod("IAudioSource", "float getVolume() const",
889  asMETHOD(cAudio::IAudioSource, getVolume), asCALL_THISCALL) < 0) {
891  }
892 
893  if(engine->RegisterObjectMethod("IAudioSource", "float getMinVolume() const",
894  asMETHOD(cAudio::IAudioSource, getMinVolume), asCALL_THISCALL) < 0) {
896  }
897 
898  if(engine->RegisterObjectMethod("IAudioSource", "float getMaxVolume() const",
899  asMETHOD(cAudio::IAudioSource, getMaxVolume), asCALL_THISCALL) < 0) {
901  }
902 
903  if(engine->RegisterObjectMethod("IAudioSource", "float getInnerConeAngle() const",
904  asMETHOD(cAudio::IAudioSource, getInnerConeAngle), asCALL_THISCALL) < 0) {
906  }
907 
908  if(engine->RegisterObjectMethod("IAudioSource", "float getOuterConeAngle() const",
909  asMETHOD(cAudio::IAudioSource, getOuterConeAngle), asCALL_THISCALL) < 0) {
911  }
912 
913  if(engine->RegisterObjectMethod("IAudioSource", "float getOuterConeVolume() const",
914  asMETHOD(cAudio::IAudioSource, getOuterConeVolume), asCALL_THISCALL) < 0) {
916  }
917 
918  if(engine->RegisterObjectMethod("IAudioSource", "float getDopplerStrength() const",
919  asMETHOD(cAudio::IAudioSource, getDopplerStrength), asCALL_THISCALL) < 0) {
921  }
922 
923  // cVector3 getDopplerVelocity() const = 0;
924 
925  if(engine->SetDefaultNamespace("") < 0) {
927  }
928 
929  return true;
930 }
#define ANGELSCRIPT_REGISTERFAIL
Definition: BindHelpers.h:10

◆ BindColour()

bool Leviathan::BindColour ( asIScriptEngine *  engine)

Definition at line 238 of file OgreBind.cpp.

239 {
240 
241  if(engine->RegisterObjectType("ColourValue", sizeof(Ogre::ColourValue),
242  asOBJ_VALUE | asGetTypeTraits<Ogre::ColourValue>() | asOBJ_POD |
243  asOBJ_APP_CLASS_ALLFLOATS) < 0) {
245  }
246 
247  if(engine->RegisterObjectBehaviour("ColourValue", asBEHAVE_CONSTRUCT,
248  "void f(float r, float g, float b, float a = 1.0)", asFUNCTION(ColourValueProxy),
249  asCALL_CDECL_OBJFIRST) < 0) {
251  }
252 
253  if(engine->RegisterObjectBehaviour("ColourValue", asBEHAVE_CONSTRUCT,
254  "void f(const Vector4 &in values)", asFUNCTION(ColourValueVector4Proxy),
255  asCALL_CDECL_OBJFIRST) < 0) {
257  }
258 
259  if(engine->RegisterObjectProperty(
260  "ColourValue", "float r", asOFFSET(Ogre::ColourValue, r)) < 0) {
262  }
263 
264  if(engine->RegisterObjectProperty(
265  "ColourValue", "float g", asOFFSET(Ogre::ColourValue, g)) < 0) {
267  }
268 
269  if(engine->RegisterObjectProperty(
270  "ColourValue", "float b", asOFFSET(Ogre::ColourValue, b)) < 0) {
272  }
273 
274  if(engine->RegisterObjectProperty(
275  "ColourValue", "float a", asOFFSET(Ogre::ColourValue, a)) < 0) {
277  }
278 
279  if(engine->RegisterObjectMethod("ColourValue",
280  "void getHSB(Real &out hue, Real &out saturation, Real &out brightness) const",
281  asMETHOD(Ogre::ColourValue, getHSB), asCALL_THISCALL) < 0) {
283  }
284 
285  if(engine->RegisterObjectMethod("ColourValue",
286  "void setHSB(Real hue, Real saturation, Real brightness)",
287  asMETHOD(Ogre::ColourValue, setHSB), asCALL_THISCALL) < 0) {
289  }
290 
291  return true;
292 }
void ColourValueVector4Proxy(void *memory, const Ogre::Vector4 &values)
Definition: OgreBind.cpp:27
void ColourValueProxy(void *memory, Ogre::Real r, Ogre::Real g, Ogre::Real b, Ogre::Real a)
Definition: OgreBind.cpp:22
#define ANGELSCRIPT_REGISTERFAIL
Definition: BindHelpers.h:10

◆ BindComponentTypeID()

bool Leviathan::BindComponentTypeID ( asIScriptEngine *  engine,
const char *  name,
uint16_t *  value 
)

Helper for BindComponentTypes.

Definition at line 103 of file EntityBind.cpp.

104 {
105  if(engine->SetDefaultNamespace(name) < 0) {
107  }
108 
109  if(engine->RegisterGlobalProperty("const uint16 TYPE", value) < 0) {
110 
112  }
113 
114  if(engine->SetDefaultNamespace("") < 0) {
116  }
117 
118  return true;
119 }
#define ANGELSCRIPT_REGISTERFAIL
Definition: BindHelpers.h:10

◆ BindComponentTypes()

bool Leviathan::BindComponentTypes ( asIScriptEngine *  engine)

Definition at line 121 of file EntityBind.cpp.

122 {
123  // ------------------------------------ //
124  // Position
125  if(engine->RegisterObjectType("Position", 0, asOBJ_REF | asOBJ_NOCOUNT) < 0) {
127  }
128 
129  if(engine->RegisterObjectProperty("Position", "bool Marked", asOFFSET(Position, Marked)) <
130  0) {
132  }
133 
134  if(engine->RegisterObjectProperty(
135  "Position", "Float3 _Position", asOFFSET(Position, Members._Position)) < 0) {
137  }
138 
139  if(engine->RegisterObjectProperty(
140  "Position", "Float4 _Orientation", asOFFSET(Position, Members._Orientation)) < 0) {
142  }
143 
144  if(!BindComponentTypeID(engine, "Position", &PositionTYPEProxy))
145  return false;
146 
147  // ------------------------------------ //
148  // Physics
149  if(engine->RegisterObjectType("Physics", 0, asOBJ_REF | asOBJ_NOCOUNT) < 0) {
151  }
152 
153  // Currently does nothing
154  if(engine->RegisterObjectProperty("Physics", "bool Marked", asOFFSET(Physics, Marked)) <
155  0) {
157  }
158 
159  if(engine->RegisterObjectMethod("Physics", "void AddForce(const Float3 &in force) const",
160  asMETHOD(Physics, AddForce), asCALL_THISCALL) < 0) {
162  }
163 
164  if(engine->RegisterObjectMethod("Physics", "Float3 GetVelocity() const",
165  asMETHODPR(Physics, GetVelocity, () const, Float3), asCALL_THISCALL) < 0) {
167  }
168 
169  if(engine->RegisterObjectMethod("Physics",
170  "void SetVelocity(const Float3 &in velocity) const", asMETHOD(Physics, SetVelocity),
171  asCALL_THISCALL) < 0) {
173  }
174 
175  if(engine->RegisterObjectMethod("Physics", "Float3 GetOmega() const",
176  asMETHODPR(Physics, GetOmega, () const, Float3), asCALL_THISCALL) < 0) {
178  }
179 
180  if(engine->RegisterObjectMethod("Physics", "void SetOmega(const Float3 &in omega) const",
181  asMETHOD(Physics, SetOmega), asCALL_THISCALL) < 0) {
183  }
184 
185  if(engine->RegisterObjectMethod("Physics", "void AddOmega(const Float3 &in omega) const",
186  asMETHOD(Physics, AddOmega), asCALL_THISCALL) < 0) {
188  }
189 
190  if(engine->RegisterObjectMethod("Physics", "Float3 ClearVelocity() const",
191  asMETHOD(Physics, ClearVelocity), asCALL_THISCALL) < 0) {
193  }
194 
195  if(engine->RegisterObjectMethod("Physics", "Float3 GetTorque() const",
196  asMETHODPR(Physics, GetTorque, () const, Float3), asCALL_THISCALL) < 0) {
198  }
199 
200  if(engine->RegisterObjectMethod("Physics", "void AddTorque(const Float3 &in torque)",
201  asMETHOD(Physics, AddTorque), asCALL_THISCALL) < 0) {
203  }
204 
205  if(engine->RegisterObjectMethod("Physics", "void SetTorque(const Float3 &in torque)",
206  asMETHOD(Physics, SetTorque), asCALL_THISCALL) < 0) {
208  }
209 
210  if(engine->RegisterObjectMethod("Physics", "NewtonBody@ get_Body() const",
211  asMETHOD(Physics, GetBody), asCALL_THISCALL) < 0) {
213  }
214 
215  if(engine->RegisterObjectMethod("Physics",
216  "NewtonBody@ CreatePhysicsBody(PhysicalWorld@ world, int physicsmaterialid = -1)",
217  asMETHOD(Physics, CreatePhysicsBody), asCALL_THISCALL) < 0) {
219  }
220 
221  if(engine->RegisterObjectMethod("Physics", "NewtonCollision@ get_Collision() const",
222  asMETHOD(Physics, GetCollision), asCALL_THISCALL) < 0) {
224  }
225 
226  if(engine->RegisterObjectMethod("Physics", "bool SetCollision(NewtonCollision@ collision)",
227  asMETHOD(Physics, SetCollision), asCALL_THISCALL) < 0) {
229  }
230 
231  if(engine->RegisterObjectMethod("Physics", "void SetMass(float mass)",
232  asMETHOD(Physics, SetMass), asCALL_THISCALL) < 0) {
234  }
235 
236  if(engine->RegisterObjectMethod("Physics", "float get_Mass() const",
237  asMETHOD(Physics, GetMass), asCALL_THISCALL) < 0) {
239  }
240 
241  if(engine->RegisterObjectMethod("Physics", "void JumpTo(Position@ positiontosync)",
242  asMETHOD(Physics, JumpTo), asCALL_THISCALL) < 0) {
244  }
245 
246  if(engine->RegisterObjectMethod("Physics",
247  "bool SetPosition(const Float3 &in pos, const Float4 &in orientation)",
248  asMETHOD(Physics, SetPosition), asCALL_THISCALL) < 0) {
250  }
251 
252  if(engine->RegisterObjectMethod("Physics",
253  "bool SetOnlyOrientation(const Float4 &in orientation)",
254  asMETHOD(Physics, SetOnlyOrientation), asCALL_THISCALL) < 0) {
256  }
257 
258  if(engine->RegisterObjectMethod("Physics",
259  "void GiveImpulse(const Float3 &in deltaspeed, const Float3 &in point = Float3(0))",
260  asMETHOD(Physics, GiveImpulse), asCALL_THISCALL) < 0) {
262  }
263 
264  if(engine->RegisterObjectMethod("Physics", "Ogre::Matrix4 GetFullMatrix() const",
265  asMETHOD(Physics, GetFullMatrix), asCALL_THISCALL) < 0) {
267  }
268 
269  if(engine->RegisterObjectMethod("Physics", "void SetLinearDamping(float factor = 0.1f)",
270  asMETHOD(Physics, SetLinearDamping), asCALL_THISCALL) < 0) {
272  }
273 
274  if(engine->RegisterObjectMethod("Physics",
275  "void SetAngularDamping(const Float3 &in factor = Float3(0.1f))",
276  asMETHOD(Physics, SetAngularDamping), asCALL_THISCALL) < 0) {
278  }
279 
280  if(engine->RegisterObjectMethod("Physics",
281  "bool CreatePlaneConstraint(PhysicalWorld@ world, const Float3 &in planenormal = "
282  "Float3(0, 1, 0))",
283  asMETHOD(Physics, CreatePlaneConstraint), asCALL_THISCALL) < 0) {
285  }
286 
287 
288  if(engine->RegisterObjectMethod(
289  "Physics", "void Release()", asMETHOD(Physics, Release), asCALL_THISCALL) < 0) {
291  }
292 
293  if(!BindComponentTypeID(engine, "Physics", &PhysicsTYPEProxy))
294  return false;
295 
296  // ------------------------------------ //
297  // RenderNode
298  if(engine->RegisterObjectType("RenderNode", 0, asOBJ_REF | asOBJ_NOCOUNT) < 0) {
300  }
301 
302  if(engine->RegisterObjectProperty(
303  "RenderNode", "bool Marked", asOFFSET(RenderNode, Marked)) < 0) {
305  }
306 
307  if(engine->RegisterObjectProperty(
308  "RenderNode", "Float3 Scale", asOFFSET(RenderNode, Scale)) < 0) {
310  }
311 
312  if(engine->RegisterObjectProperty(
313  "RenderNode", "Ogre::SceneNode@ Node", asOFFSET(RenderNode, Node)) < 0) {
315  }
316 
317  if(engine->RegisterObjectProperty(
318  "RenderNode", "bool Hidden", asOFFSET(RenderNode, Hidden)) < 0) {
320  }
321 
322  if(!BindComponentTypeID(engine, "RenderNode", &RenderNodeTYPEProxy))
323  return false;
324 
325  // ------------------------------------ //
326  // Sendable
327  if(engine->RegisterObjectType("Sendable", 0, asOBJ_REF | asOBJ_NOCOUNT) < 0) {
329  }
330 
331  if(engine->RegisterObjectProperty("Sendable", "bool Marked", asOFFSET(Sendable, Marked)) <
332  0) {
334  }
335 
336  if(!BindComponentTypeID(engine, "Sendable", &SendableTYPEProxy))
337  return false;
338 
339  // ------------------------------------ //
340  // Received
341  if(engine->RegisterObjectType("Received", 0, asOBJ_REF | asOBJ_NOCOUNT) < 0) {
343  }
344 
345  if(engine->RegisterObjectProperty("Received", "bool Marked", asOFFSET(Received, Marked)) <
346  0) {
348  }
349 
350  if(!BindComponentTypeID(engine, "Received", &ReceivedTYPEProxy))
351  return false;
352 
353  // ------------------------------------ //
354  // Model
355  if(engine->RegisterObjectType("Model", 0, asOBJ_REF | asOBJ_NOCOUNT) < 0) {
357  }
358 
359  if(engine->RegisterObjectProperty("Model", "bool Marked", asOFFSET(Model, Marked)) < 0) {
361  }
362 
363  if(!BindComponentTypeID(engine, "Model", &ModelTYPEProxy))
364  return false;
365 
366  if(engine->RegisterObjectProperty(
367  "Model", "Ogre::Item@ GraphicalObject", asOFFSET(Model, GraphicalObject)) < 0) {
369  }
370 
371  // ------------------------------------ //
372  // BoxGeometry
373  if(engine->RegisterObjectType("BoxGeometry", 0, asOBJ_REF | asOBJ_NOCOUNT) < 0) {
375  }
376 
377  if(engine->RegisterObjectProperty(
378  "BoxGeometry", "bool Marked", asOFFSET(BoxGeometry, Marked)) < 0) {
380  }
381 
382  if(!BindComponentTypeID(engine, "BoxGeometry", &BoxGeometryTYPEProxy))
383  return false;
384 
385  // ------------------------------------ //
386  // ManualObject
387  if(engine->RegisterObjectType("ManualObject", 0, asOBJ_REF | asOBJ_NOCOUNT) < 0) {
389  }
390 
391  if(engine->RegisterObjectProperty(
392  "ManualObject", "bool Marked", asOFFSET(ManualObject, Marked)) < 0) {
394  }
395 
396  if(!BindComponentTypeID(engine, "ManualObject", &ManualObjectTYPEProxy))
397  return false;
398 
399  // ------------------------------------ //
400  // Camera
401  if(engine->RegisterObjectType("Camera", 0, asOBJ_REF | asOBJ_NOCOUNT) < 0) {
403  }
404 
405  if(engine->RegisterObjectProperty("Camera", "bool Marked", asOFFSET(Camera, Marked)) < 0) {
407  }
408 
409  if(engine->RegisterObjectProperty("Camera", "uint8 FOVY", asOFFSET(Camera, FOVY)) < 0) {
411  }
412 
413  if(engine->RegisterObjectProperty(
414  "Camera", "bool SoundPerceiver", asOFFSET(Camera, SoundPerceiver)) < 0) {
416  }
417 
418  if(!BindComponentTypeID(engine, "Camera", &CameraTYPEProxy))
419  return false;
420 
421 
422  // ------------------------------------ //
423  // Plane
424  if(engine->RegisterObjectType("Plane", 0, asOBJ_REF | asOBJ_NOCOUNT) < 0) {
426  }
427 
428  if(engine->RegisterObjectProperty("Plane", "bool Marked", asOFFSET(Plane, Marked)) < 0) {
430  }
431 
432  if(!BindComponentTypeID(engine, "Plane", &PlaneTYPEProxy))
433  return false;
434 
435  if(engine->RegisterObjectProperty(
436  "Plane", "Ogre::Item@ GraphicalObject", asOFFSET(Plane, GraphicalObject)) < 0) {
438  }
439 
440  // ------------------------------------ //
441  // Animated
442  if(engine->RegisterObjectType("Animated", 0, asOBJ_REF | asOBJ_NOCOUNT) < 0) {
444  }
445 
446  if(engine->RegisterObjectProperty("Animated", "bool Marked", asOFFSET(Animated, Marked)) <
447  0) {
449  }
450 
451  if(!BindComponentTypeID(engine, "Animated", &AnimatedTYPEProxy))
452  return false;
453 
454  if(engine->RegisterObjectProperty("Animated", "Ogre::Item@ GraphicalObject",
455  asOFFSET(Animated, GraphicalObject)) < 0) {
457  }
458 
459  // ------------------------------------ //
460  // SimpleAnimation
461  if(engine->RegisterObjectType("SimpleAnimation", sizeof(SimpleAnimation),
462  asOBJ_VALUE | asGetTypeTraits<SimpleAnimation>()) < 0) {
464  }
465  if(engine->RegisterObjectBehaviour("SimpleAnimation", asBEHAVE_CONSTRUCT,
466  "void f(const string &in name)", asFUNCTION(SimpleAnimationConstructorProxy),
467  asCALL_CDECL_OBJFIRST) < 0) {
469  }
470  if(engine->RegisterObjectBehaviour("SimpleAnimation", asBEHAVE_DESTRUCT, "void f()",
471  asFUNCTION(SimpleAnimationDestructorProxy), asCALL_CDECL_OBJFIRST) < 0) {
473  }
474 
475  if(engine->RegisterObjectProperty(
476  "SimpleAnimation", "bool Loop", asOFFSET(SimpleAnimation, Loop)) < 0) {
478  }
479 
480  if(engine->RegisterObjectProperty("SimpleAnimation", "float SpeedFactor",
481  asOFFSET(SimpleAnimation, SpeedFactor)) < 0) {
483  }
484 
485  if(engine->RegisterObjectProperty(
486  "SimpleAnimation", "bool Paused", asOFFSET(SimpleAnimation, Paused)) < 0) {
488  }
489 
490  // Animation helpers
491  if(engine->RegisterObjectMethod("Animated",
492  "void AddAnimation(const SimpleAnimation &in animation)",
493  asFUNCTION(AnimatedAddHelper), asCALL_CDECL_OBJFIRST) < 0) {
495  }
496 
497  if(engine->RegisterObjectMethod("Animated", "SimpleAnimation& GetAnimation(uint64 index)",
498  asFUNCTION(AnimatedGetHelper), asCALL_CDECL_OBJFIRST) < 0) {
500  }
501 
502  return true;
503 }
Plane component.
Definition: Components.h:297
Entity is received from a server.
Definition: Components.h:161
static uint16_t SendableTYPEProxy
Definition: EntityBind.cpp:93
static uint16_t PhysicsTYPEProxy
Definition: EntityBind.cpp:90
static uint16_t ReceivedTYPEProxy
Definition: EntityBind.cpp:94
void SimpleAnimationDestructorProxy(void *memory)
Definition: EntityBind.cpp:42
Contains an nimation for Animated component.
Definition: Components.h:241
static uint16_t BoxGeometryTYPEProxy
Definition: EntityBind.cpp:96
void SimpleAnimationConstructorProxy(void *memory, const std::string &name)
Definition: EntityBind.cpp:37
Entity has a box for geometry/model, possibly also physics.
Definition: Components.h:202
Entity has position and direction it is looking at.
Definition: Components.h:45
Entity has an Ogre scene node.
Definition: Components.h:73
void AnimatedAddHelper(Animated *self, const SimpleAnimation &animation)
Definition: EntityBind.cpp:47
Entity has a physical component.
Definition: Components.h:319
SimpleAnimation * AnimatedGetHelper(Animated *self, uint64_t index)
Definition: EntityBind.cpp:53
static uint16_t PlaneTYPEProxy
Definition: EntityBind.cpp:99
Entity has a model.
Definition: Components.h:224
static uint16_t AnimatedTYPEProxy
Definition: EntityBind.cpp:100
Properties that a camera entity has (will also need a Position component)
Definition: Components.h:779
static uint16_t ModelTYPEProxy
Definition: EntityBind.cpp:95
#define ANGELSCRIPT_REGISTERFAIL
Definition: BindHelpers.h:10
bool BindComponentTypeID(asIScriptEngine *engine, const char *name, uint16_t *value)
Helper for BindComponentTypes.
Definition: EntityBind.cpp:103
Entity plays animations on an Ogre::Item.
Definition: Components.h:277
Entity is sendable to clients.
Definition: Components.h:98
static uint16_t ManualObjectTYPEProxy
Definition: EntityBind.cpp:98
static uint16_t PositionTYPEProxy
Definition: EntityBind.cpp:91
static uint16_t RenderNodeTYPEProxy
Definition: EntityBind.cpp:92
static uint16_t CameraTYPEProxy
Definition: EntityBind.cpp:97

◆ BindDataBlock()

bool Leviathan::BindDataBlock ( asIScriptEngine *  engine)

Definition at line 290 of file CommonEngineBind.cpp.

291 {
292 
293  ANGELSCRIPT_REGISTER_REF_TYPE("ScriptSafeVariableBlock", ScriptSafeVariableBlock);
294 
295  // Some factories //
296  if(engine->RegisterObjectBehaviour("ScriptSafeVariableBlock", asBEHAVE_FACTORY,
297  "ScriptSafeVariableBlock@ f(const string &in blockname, const string &in value)",
298  asFUNCTION(ScriptSafeVariableBlockFactoryString), asCALL_CDECL) < 0) {
300  }
301 
302  if(engine->RegisterObjectBehaviour("ScriptSafeVariableBlock", asBEHAVE_FACTORY,
303  "ScriptSafeVariableBlock@ f(const string &in blockname, float value)",
304  asFUNCTION(ScriptSafeVariableBlockFactoryGeneric<float>), asCALL_CDECL) < 0) {
306  }
307 
308  if(engine->RegisterObjectBehaviour("ScriptSafeVariableBlock", asBEHAVE_FACTORY,
309  "ScriptSafeVariableBlock@ f(const string &in blockname, int value)",
310  asFUNCTION(ScriptSafeVariableBlockFactoryGeneric<int>), asCALL_CDECL) < 0) {
312  }
313 
314  if(engine->RegisterObjectBehaviour("ScriptSafeVariableBlock", asBEHAVE_FACTORY,
315  "ScriptSafeVariableBlock@ f(const string &in blockname, double value)",
316  asFUNCTION(ScriptSafeVariableBlockFactoryGeneric<double>), asCALL_CDECL) < 0) {
318  }
319 
320  if(engine->RegisterObjectBehaviour("ScriptSafeVariableBlock", asBEHAVE_FACTORY,
321  "ScriptSafeVariableBlock@ f(const string &in blockname, int8 value)",
322  asFUNCTION(ScriptSafeVariableBlockFactoryGeneric<char>), asCALL_CDECL) < 0) {
324  }
325 
326  if(engine->RegisterObjectBehaviour("ScriptSafeVariableBlock", asBEHAVE_FACTORY,
327  "ScriptSafeVariableBlock@ f(const string &in blockname, bool value)",
328  asFUNCTION(ScriptSafeVariableBlockFactoryGeneric<bool>), asCALL_CDECL) < 0) {
330  }
331 
332  // Implicit casts for normal types //
333  if(engine->RegisterObjectMethod("ScriptSafeVariableBlock", "string opImplConv() const",
334  WRAP_MFN(ScriptSafeVariableBlock, ConvertAndReturnVariable<std::string>),
335  asCALL_GENERIC) < 0) {
337  }
338 
339  if(engine->RegisterObjectMethod("ScriptSafeVariableBlock", "int opImplConv() const",
340  WRAP_MFN(ScriptSafeVariableBlock, ConvertAndReturnVariable<int>),
341  asCALL_GENERIC) < 0) {
343  }
344 
345  if(engine->RegisterObjectMethod("ScriptSafeVariableBlock", "int8 opImplConv() const",
346  WRAP_MFN(ScriptSafeVariableBlock, ConvertAndReturnVariable<char>),
347  asCALL_GENERIC) < 0) {
349  }
350 
351  if(engine->RegisterObjectMethod("ScriptSafeVariableBlock", "float opImplConv() const",
352  WRAP_MFN(ScriptSafeVariableBlock, ConvertAndReturnVariable<float>),
353  asCALL_GENERIC) < 0) {
355  }
356 
357  if(engine->RegisterObjectMethod("ScriptSafeVariableBlock", "double opImplConv() const",
358  WRAP_MFN(ScriptSafeVariableBlock, ConvertAndReturnVariable<double>),
359  asCALL_GENERIC) < 0) {
361  }
362 
363  if(engine->RegisterObjectMethod("ScriptSafeVariableBlock", "bool opImplConv() const",
364  WRAP_MFN(ScriptSafeVariableBlock, ConvertAndReturnVariable<bool>),
365  asCALL_GENERIC) < 0) {
367  }
368 
369  // type check //
370  if(engine->RegisterObjectMethod("ScriptSafeVariableBlock", "bool IsValidType()",
371  asMETHOD(ScriptSafeVariableBlock, IsValidType), asCALL_THISCALL) < 0) {
373  }
374 
375 
376  return true;
377 }
#define ANGELSCRIPT_REGISTER_REF_TYPE(RegisterName, ClassName)
Definition: BindHelpers.h:90
Reference counted version for scripts of VariableBlock.
Definition: DataBlock.h:840
#define ANGELSCRIPT_REGISTERFAIL
Definition: BindHelpers.h:10
ScriptSafeVariableBlock * ScriptSafeVariableBlockFactoryString(const std::string &blockname, const std::string &valuestr)

◆ BindDelegates()

bool Leviathan::BindDelegates ( asIScriptEngine *  engine)

Definition at line 644 of file CommonEngineBind.cpp.

645 {
646 
647  if(engine->RegisterFuncdef("void DelegateCallbackFunc(NamedVars@ values)") < 0) {
649  }
650 
652 
653  if(engine->RegisterObjectMethod("Delegate", "void Call(NamedVars@ values) const",
654  asMETHODPR(Delegate, Call, (NamedVars*)const, void), asCALL_THISCALL) < 0) {
656  }
657 
658  if(engine->RegisterObjectMethod("Delegate",
659  "void Register(DelegateCallbackFunc@ callback)", asFUNCTION(DelegateRegisterProxy),
660  asCALL_CDECL_OBJFIRST) < 0) {
662  }
663 
664 
665  return true;
666 }
#define ANGELSCRIPT_REGISTER_REF_TYPE(RegisterName, ClassName)
Definition: BindHelpers.h:90
An object which can accept BaseDelegateSlot derived callbacks that can be called when the event repre...
Definition: DelegateSlot.h:52
#define ANGELSCRIPT_REGISTERFAIL
Definition: BindHelpers.h:10
static void DelegateRegisterProxy(Delegate *obj, asIScriptFunction *callback)

◆ BindEngine()

bool Leviathan::BindEngine ( asIScriptEngine *  engine)

Definition at line 507 of file CommonEngineBind.cpp.

508 {
509 
510  if(engine->RegisterObjectType("Engine", 0, asOBJ_REF | asOBJ_NOHANDLE) < 0) {
512  }
513 
514  // Global get function //
515  if(engine->RegisterGlobalFunction(
516  "Engine& GetEngine()", asFUNCTION(Engine::Get), asCALL_CDECL) < 0) {
518  }
519 
520  // Engine owned singletons //
521  if(!BindRandom(engine))
522  return false;
523 
524  if(engine->RegisterObjectMethod("Engine", "Random& GetRandom()",
525  asMETHOD(Engine, GetRandom), asCALL_THISCALL) < 0) {
527  }
528 
529  if(engine->RegisterObjectMethod("Engine", "EventHandler& GetEventHandler()",
530  asMETHOD(Engine, GetEventHandler), asCALL_THISCALL) < 0) {
532  }
533 
534  if(engine->RegisterObjectMethod("Engine", "SoundDevice& GetSoundDevice()",
535  asMETHOD(Engine, GetSoundDevice), asCALL_THISCALL) < 0) {
537  }
538 
539  if(engine->RegisterObjectMethod("Engine", "FileSystem& GetFileSystem()",
540  asMETHOD(Engine, GetFileSystem), asCALL_THISCALL) < 0) {
542  }
543 
544  if(engine->RegisterObjectMethod("Engine", "ThreadingManager& GetThreadingManager()",
545  asMETHOD(Engine, GetThreadingManager), asCALL_THISCALL) < 0) {
547  }
548 
549  // ------------------------------------ //
550 
551  if(engine->RegisterObjectMethod("Engine", "int64 GetTimeSinceLastTick()",
552  asMETHOD(Engine, GetTimeSinceLastTick), asCALL_THISCALL) < 0) {
554  }
555 
556  if(engine->RegisterObjectMethod("Engine", "int GetCurrentTick()",
557  asMETHOD(Engine, GetCurrentTick), asCALL_THISCALL) < 0) {
559  }
560 
561  if(engine->RegisterObjectMethod("Engine", "int GetWindowOpenCount()",
562  asMETHOD(Engine, GetWindowOpenCount), asCALL_THISCALL) < 0) {
564  }
565 
566  if(engine->RegisterObjectMethod(
567  "Engine", "void MarkQuit()", asMETHOD(Engine, MarkQuit), asCALL_THISCALL) < 0) {
569  }
570 
571  if(engine->RegisterObjectMethod("Engine", "bool IsOnMainThread()",
572  asMETHOD(Engine, IsOnMainThread), asCALL_THISCALL) < 0) {
574  }
575 
576  if(engine->RegisterFuncdef("void InvokeCallbackFunc()") < 0) {
578  }
579 
580  if(engine->RegisterObjectMethod("Engine", "void Invoke(InvokeCallbackFunc@ callback)",
581  asFUNCTION(InvokeProxy), asCALL_CDECL_OBJFIRST) < 0) {
583  }
584 
585  return true;
586 }
The main class of the Leviathan Game Engine.
Definition: Engine.h:24
bool BindRandom(asIScriptEngine *engine)
static void InvokeProxy(Engine *obj, asIScriptFunction *callback)
#define ANGELSCRIPT_REGISTERFAIL
Definition: BindHelpers.h:10

◆ BindEngineCommon()

bool Leviathan::BindEngineCommon ( asIScriptEngine *  engine)

Definition at line 1041 of file CommonEngineBind.cpp.

1042 {
1043 
1044  if(!BindNamedVars(engine))
1045  return false;
1046 
1047  if(!BindEvents(engine))
1048  return false;
1049 
1050  if(!BindcAudio(engine))
1051  return false;
1052 
1053  if(!BindSound(engine))
1054  return false;
1055 
1056  if(!BindFileSystem(engine))
1057  return false;
1058 
1059  if(!BindThreadingManager(engine))
1060  return false;
1061 
1062  if(!BindEngine(engine))
1063  return false;
1064 
1065  if(!BindApplication(engine))
1066  return false;
1067 
1068  if(!BindGameModule(engine))
1069  return false;
1070 
1071  if(!BindDelegates(engine))
1072  return false;
1073 
1074 
1075  // ------------------ Global functions ------------------ //
1076  if(engine->RegisterGlobalFunction("string GetLeviathanVersion()",
1077  asFUNCTION(GetLeviathanVersionProxy), asCALL_CDECL) < 0) {
1079  }
1080 
1081  if(engine->RegisterGlobalFunction("void LOG_WRITE(const string &in message)",
1082  asFUNCTION(LOG_WRITEProxy), asCALL_CDECL) < 0) {
1084  }
1085 
1086  if(engine->RegisterGlobalFunction("void LOG_INFO(const string &in message)",
1087  asFUNCTION(LOG_INFOProxy), asCALL_CDECL) < 0) {
1089  }
1090 
1091  if(engine->RegisterGlobalFunction("void LOG_WARNING(const string &in message)",
1092  asFUNCTION(LOG_WARNINGProxy), asCALL_CDECL) < 0) {
1094  }
1095 
1096  if(engine->RegisterGlobalFunction("void LOG_ERROR(const string &in message)",
1097  asFUNCTION(LOG_ERRORProxy), asCALL_CDECL) < 0) {
1099  }
1100  // LOG_FATAL not bound
1101  // Use assert instead
1102 
1103  if(engine->RegisterGlobalFunction("void Print(const string &in message)",
1104  asFUNCTION(Logger::Print), asCALL_CDECL) < 0) {
1106  }
1107 
1108  if(engine->RegisterGlobalFunction("void assert(bool expression, const string &in message)",
1109  asFUNCTION(AngelScriptAssertWrapper), asCALL_GENERIC) < 0) {
1111  }
1112  if(engine->RegisterGlobalFunction("void assert(bool expression)",
1113  asFUNCTION(AngelScriptAssertWrapper), asCALL_GENERIC) < 0) {
1115  }
1116 
1117  if(engine->RegisterGlobalFunction(
1118  "void PrintCallStack()", asFUNCTION(PrintASCallStack), asCALL_CDECL) < 0) {
1120  }
1121 
1122  // ------------------------------------ //
1123  // Global vars
1124  if(engine->RegisterGlobalProperty("const float PI", &PIProxy) < 0) {
1125 
1127  }
1128 
1129  if(engine->RegisterGlobalProperty("const float EPSILON", &EPSILONProxy) < 0) {
1130 
1132  }
1133 
1134  if(engine->RegisterGlobalProperty(
1135  "const float DEGREES_TO_RADIANS", &DEGREES_TO_RADIANSProxy) < 0) {
1136 
1138  }
1139 
1140  if(engine->RegisterGlobalProperty(
1141  "const float RADIANS_TO_DEGREES", &RADIANS_TO_DEGREESProxy) < 0) {
1142 
1144  }
1145 
1146  if(engine->RegisterGlobalProperty("const int TICKSPEED", &TICKSPEEDProxy) < 0) {
1147 
1149  }
1150 
1151 
1152  return true;
1153 }
bool BindEngine(asIScriptEngine *engine)
bool BindEvents(asIScriptEngine *engine)
static std::string GetLeviathanVersionProxy()
void PrintASCallStack()
Prints current angelscript callstack.
bool BindcAudio(asIScriptEngine *engine)
bool BindNamedVars(asIScriptEngine *engine)
bool BindDelegates(asIScriptEngine *engine)
static void LOG_ERRORProxy(const std::string &str)
static void LOG_WARNINGProxy(const std::string &str)
static void LOG_INFOProxy(const std::string &str)
static void LOG_WRITEProxy(const std::string &str)
bool BindThreadingManager(asIScriptEngine *engine)
bool BindFileSystem(asIScriptEngine *engine)
static float RADIANS_TO_DEGREESProxy
bool BindApplication(asIScriptEngine *engine)
static float EPSILONProxy
bool BindGameModule(asIScriptEngine *engine)
static float PIProxy
void AngelScriptAssertWrapper(asIScriptGeneric *gen)
#define ANGELSCRIPT_REGISTERFAIL
Definition: BindHelpers.h:10
static float DEGREES_TO_RADIANSProxy
bool BindSound(asIScriptEngine *engine)
static int TICKSPEEDProxy

◆ BindEntity()

bool Leviathan::BindEntity ( asIScriptEngine *  engine)
Todo:
Create a wrapper around NewtonBody which has reference counting

Definition at line 628 of file EntityBind.cpp.

629 {
630 
631  // TODO: add reference counting for GameWorld
632  if(engine->RegisterObjectType("GameWorld", 0, asOBJ_REF | asOBJ_NOCOUNT) < 0) {
634  }
635 
636  if(!BindScriptComponentTypeSupport(engine))
637  return false;
638 
639  if(!BindRayCast(engine))
640  return false;
641 
642  if(!BindComponentTypes(engine))
643  return false;
644 
645  if(!BindGameWorldBaseMethods<GameWorld>(engine, "GameWorld"))
646  return false;
647 
648  // Component get functions //
649  // GameWorld
650 
651  // ------------------------------------ //
652  if(engine->RegisterObjectType("StandardWorld", 0, asOBJ_REF | asOBJ_NOCOUNT) < 0) {
654  }
655 
656  if(!BindStandardWorldMethods<StandardWorld>(engine, "StandardWorld"))
657  return false;
658 
659  // ------------------------------------ //
660 
661  return true;
662 }
bool BindScriptComponentTypeSupport(asIScriptEngine *engine)
Definition: EntityBind.cpp:505
bool BindRayCast(asIScriptEngine *engine)
Definition: EntityBind.cpp:67
bool BindComponentTypes(asIScriptEngine *engine)
Definition: EntityBind.cpp:121
#define ANGELSCRIPT_REGISTERFAIL
Definition: BindHelpers.h:10

◆ BindEvents()

bool Leviathan::BindEvents ( asIScriptEngine *  engine)

Definition at line 379 of file CommonEngineBind.cpp.

380 {
381 
382  // bind event type enum //
383  if(engine->RegisterEnum("EVENT_TYPE") < 0) {
385  }
386 
391 
392  // bind event //
394 
395  if(engine->RegisterObjectBehaviour("Event", asBEHAVE_FACTORY, "Event@ f(EVENT_TYPE type)",
396  asFUNCTION(WrapperEventFactory), asCALL_CDECL) < 0) {
398  }
399 
400  // bind generic event //
402 
403  // Factory //
404  if(engine->RegisterObjectBehaviour("GenericEvent", asBEHAVE_FACTORY,
405  "GenericEvent@ f(const string &in typename)",
406  asFUNCTION(WrapperGenericEventFactory), asCALL_CDECL) < 0) {
408  }
409 
410  // Data get function //
411  if(engine->RegisterObjectMethod("GenericEvent", "NamedVars@ GetNamedVars()",
412  asMETHOD(GenericEvent, GetNamedVarsRefCounted), asCALL_THISCALL) < 0) {
414  }
415 
416 
417  // Event handler which cannot be instantiated or copied around //
418  if(engine->RegisterObjectType("EventHandler", 0, asOBJ_REF | asOBJ_NOHANDLE) < 0) {
420  }
421 
422  // Script event firing //
423  if(engine->RegisterObjectMethod("EventHandler", "void CallEvent(GenericEvent@ event)",
424  asMETHODPR(EventHandler, CallEvent, (GenericEvent*), void), asCALL_THISCALL) < 0) {
426  }
427 
428  // Event listener //
430 
431  if(engine->RegisterFuncdef("int OnEventCallback(Event@ event)") < 0) {
433  }
434 
435  if(engine->RegisterFuncdef("int OnGenericEventCallback(GenericEvent@ event)") < 0) {
437  }
438 
439  if(engine->RegisterObjectBehaviour("EventListener", asBEHAVE_FACTORY,
440  "EventListener@ f(OnEventCallback@ onevent, OnGenericEventCallback@ ongeneric)",
441  asFUNCTION(Script::EventListenerFactory), asCALL_CDECL) < 0) {
443  }
444 
445  if(engine->RegisterObjectMethod("EventListener", "bool RegisterForEvent(EVENT_TYPE type)",
446  asMETHOD(Script::EventListener, RegisterForEventType), asCALL_THISCALL) < 0) {
448  }
449 
450  if(engine->RegisterObjectMethod("EventListener",
451  "bool RegisterForEvent(const string &in name)",
452  asMETHOD(Script::EventListener, RegisterForEventGeneric), asCALL_THISCALL) < 0) {
454  }
455 
456 
457  return true;
458 }
Class that represents a statically defined event.
Definition: Event.h:128
Allows object to register for events that can be fired from anywhere.
Definition: EventHandler.h:12
#define ANGELSCRIPT_REGISTER_REF_TYPE(RegisterName, ClassName)
Definition: BindHelpers.h:90
EVENT_TYPE
Engine events that are triggered at certain times.
Definition: Event.h:13
#define ANGELSCRIPT_REGISTER_ENUM_VALUE(enum, x)
Definition: BindHelpers.h:105
Class that represents a dynamically defined event.
Definition: Event.h:161
EventListener * EventListenerFactory(asIScriptFunction *onevent, asIScriptFunction *ongeneric)
Event * WrapperEventFactory(EVENT_TYPE type)
GenericEvent * WrapperGenericEventFactory(const std::string &name)
#define ANGELSCRIPT_REGISTERFAIL
Definition: BindHelpers.h:10

◆ BindFileSystem()

bool Leviathan::BindFileSystem ( asIScriptEngine *  engine)

Definition at line 984 of file CommonEngineBind.cpp.

985 {
986  // Many of the filesystem methods aren't safe to expose to every
987  // script so they are hidden by default
988  if(engine->RegisterEnum("FILEGROUP") < 0) {
990  }
991 
997 
998  if(engine->RegisterObjectType("FileSystem", 0, asOBJ_REF | asOBJ_NOHANDLE) < 0) {
1000  }
1001 
1002  const auto oldMask =
1003  engine->SetDefaultAccessMask(static_cast<AccessFlags>(ScriptAccess::FullFileSystem));
1004 
1005  if(engine->RegisterObjectMethod("FileSystem",
1006  "string SearchForFile(FILEGROUP which, const string &in name, const string &in "
1007  "extensions, bool searchall = true)",
1008  asMETHOD(FileSystem, SearchForFile), asCALL_THISCALL) < 0) {
1010  }
1011 
1012  // Restore access for non-full access requiring static stuff
1013  engine->SetDefaultAccessMask(oldMask);
1014 
1015  // ------------------------------------ //
1016  // Static methods
1017  if(engine->SetDefaultNamespace("FileSystem") < 0) {
1019  }
1020 
1021  // And back to protected functions
1022  engine->SetDefaultAccessMask(static_cast<AccessFlags>(ScriptAccess::FullFileSystem));
1023 
1024  if(engine->RegisterGlobalFunction("bool FileExists(const string &in filepath)",
1025  asFUNCTION(FileSystem::FileExists), asCALL_CDECL) < 0) {
1026 
1028  }
1029 
1030  // Restore settings //
1031  engine->SetDefaultAccessMask(oldMask);
1032  if(engine->SetDefaultNamespace("") < 0) {
1034  }
1035 
1036  return true;
1037 }
Class for indexing and searching game data directory.
Definition: FileSystem.h:66
#define ANGELSCRIPT_REGISTER_ENUM_VALUE(enum, x)
Definition: BindHelpers.h:105
#define ANGELSCRIPT_REGISTERFAIL
Definition: BindHelpers.h:10

◆ BindFloat2()

bool Leviathan::BindFloat2 ( asIScriptEngine *  engine)

Definition at line 205 of file TypesBind.cpp.

206 {
207 
208  if(engine->RegisterObjectType("Float2", sizeof(Float2),
209  asOBJ_VALUE | asGetTypeTraits<Float2>() | asOBJ_APP_CLASS_ALLFLOATS) < 0) {
211  }
212  if(engine->RegisterObjectBehaviour("Float2", asBEHAVE_CONSTRUCT, "void f()",
213  asFUNCTION(Float2ConstructorProxy), asCALL_CDECL_OBJFIRST) < 0) {
215  }
216  if(engine->RegisterObjectBehaviour("Float2", asBEHAVE_CONSTRUCT, "void f(float value)",
217  asFUNCTION(Float2ConstructorProxySingle), asCALL_CDECL_OBJFIRST) < 0) {
219  }
220  if(engine->RegisterObjectBehaviour("Float2", asBEHAVE_CONSTRUCT,
221  "void f(float x, float y)", asFUNCTION(Float2ConstructorProxyAll),
222  asCALL_CDECL_OBJFIRST) < 0) {
224  }
225  if(engine->RegisterObjectBehaviour("Float2", asBEHAVE_CONSTRUCT,
226  "void f(const Float2 &in other)", asFUNCTION(Float2ConstructorProxyCopy),
227  asCALL_CDECL_OBJFIRST) < 0) {
229  }
230  if(engine->RegisterObjectBehaviour("Float2", asBEHAVE_DESTRUCT, "void f()",
231  asFUNCTION(Float2DestructorProxy), asCALL_CDECL_OBJFIRST) < 0) {
233  }
234  // Operators //
235  if(engine->RegisterObjectMethod("Float2", "Float2& opAssign(const Float2 &in other)",
236  asMETHODPR(Float2, operator=,(const Float2&), Float2&), asCALL_THISCALL) < 0) {
238  }
239 
240  if(engine->RegisterObjectMethod("Float2", "Float2 opAdd(const Float2 &in other) const",
241  asMETHODPR(Float2, operator+,(const Float2&) const, Float2), asCALL_THISCALL) < 0) {
243  }
244 
245  if(engine->RegisterObjectMethod("Float2", "Float2 opSub(const Float2 &in other) const",
246  asMETHODPR(Float2, operator-,(const Float2&) const, Float2), asCALL_THISCALL) < 0) {
248  }
249 
250  if(engine->RegisterObjectMethod("Float2", "Float2 opMul(float multiply) const",
251  asMETHODPR(Float2, operator*,(float) const, Float2), asCALL_THISCALL) < 0) {
253  }
254 
255  if(engine->RegisterObjectMethod("Float2", "Float2 Normalize() const",
256  asMETHOD(Float2, Normalize), asCALL_THISCALL) < 0) {
258  }
259 
260  if(engine->RegisterObjectMethod(
261  "Float2", "float HAddAbs()", asMETHOD(Float2, HAddAbs), asCALL_THISCALL) < 0) {
263  }
264 
265  if(engine->RegisterObjectMethod("Float2", "bool HasInvalidValues() const",
266  asMETHOD(Float2, HasInvalidValues), asCALL_THISCALL) < 0) {
268  }
269 
270  // Direct access
271  if(engine->RegisterObjectProperty("Float2", "float X", asOFFSET(Float2, X)) < 0) {
272 
274  }
275 
276  if(engine->RegisterObjectProperty("Float2", "float Y", asOFFSET(Float2, Y)) < 0) {
277 
279  }
280 
281  return true;
282 }
void Float2ConstructorProxyAll(void *memory, float x, float y)
Definition: TypesBind.cpp:23
void Float2ConstructorProxy(void *memory)
Definition: TypesBind.cpp:18
void Float2ConstructorProxyCopy(void *memory, const Float2 &other)
Definition: TypesBind.cpp:33
#define ANGELSCRIPT_REGISTERFAIL
Definition: BindHelpers.h:10
void Float2DestructorProxy(void *memory)
Definition: TypesBind.cpp:38
void Float2ConstructorProxySingle(void *memory, float all)
Definition: TypesBind.cpp:28

◆ BindFloat3()

bool Leviathan::BindFloat3 ( asIScriptEngine *  engine)

Definition at line 284 of file TypesBind.cpp.

285 {
286 
287  if(engine->RegisterObjectType("Float3", sizeof(Float3),
288  asOBJ_VALUE | asGetTypeTraits<Float3>() | asOBJ_APP_CLASS_ALLFLOATS) < 0) {
290  }
291  if(engine->RegisterObjectBehaviour("Float3", asBEHAVE_CONSTRUCT, "void f()",
292  asFUNCTION(Float3ConstructorProxy), asCALL_CDECL_OBJFIRST) < 0) {
294  }
295  if(engine->RegisterObjectBehaviour("Float3", asBEHAVE_CONSTRUCT, "void f(float value)",
296  asFUNCTION(Float3ConstructorProxySingle), asCALL_CDECL_OBJFIRST) < 0) {
298  }
299  if(engine->RegisterObjectBehaviour("Float3", asBEHAVE_CONSTRUCT,
300  "void f(float x, float y, float z)", asFUNCTION(Float3ConstructorProxyAll),
301  asCALL_CDECL_OBJFIRST) < 0) {
303  }
304  if(engine->RegisterObjectBehaviour("Float3", asBEHAVE_CONSTRUCT,
305  "void f(const Float3 &in other)", asFUNCTION(Float3ConstructorProxyCopy),
306  asCALL_CDECL_OBJFIRST) < 0) {
308  }
309  if(engine->RegisterObjectBehaviour("Float3", asBEHAVE_DESTRUCT, "void f()",
310  asFUNCTION(Float3DestructorProxy), asCALL_CDECL_OBJFIRST) < 0) {
312  }
313  // Operators //
314  if(engine->RegisterObjectMethod("Float3", "Float3& opAssign(const Float3 &in other)",
315  asMETHODPR(Float3, operator=,(const Float3&), Float3&), asCALL_THISCALL) < 0) {
317  }
318 
319  if(engine->RegisterObjectMethod("Float3", "Float3 opAdd(const Float3 &in other) const",
320  asMETHODPR(Float3, operator+,(const Float3&) const, Float3), asCALL_THISCALL) < 0) {
322  }
323 
324  if(engine->RegisterObjectMethod("Float3", "Float3 opNeg() const",
325  asMETHODPR(Float3, operator-,() const, Float3), asCALL_THISCALL) < 0) {
327  }
328 
329  if(engine->RegisterObjectMethod("Float3", "bool opEquals(const Float3 &in other) const",
330  asMETHODPR(Float3, operator==,(const Float3&) const, bool), asCALL_THISCALL) < 0) {
332  }
333 
334  if(engine->RegisterObjectMethod("Float3", "Float3& opAddAssign(const Float3 &in other)",
335  asMETHODPR(Float3, operator+=,(const Float3&), Float3&), asCALL_THISCALL) < 0) {
337  }
338 
339  if(engine->RegisterObjectMethod("Float3", "Float3& opSubAssign(const Float3 &in other)",
340  asMETHODPR(Float3, operator-=,(const Float3&), Float3&), asCALL_THISCALL) < 0) {
342  }
343 
344  if(engine->RegisterObjectMethod("Float3", "Float3 opSub(const Float3 &in other) const",
345  asMETHODPR(Float3, operator-,(const Float3&) const, Float3), asCALL_THISCALL) < 0) {
347  }
348 
349  if(engine->RegisterObjectMethod("Float3", "Float3 opMul(float multiply) const",
350  asMETHODPR(Float3, operator*,(float) const, Float3), asCALL_THISCALL) < 0) {
352  }
353 
354  if(engine->RegisterObjectMethod("Float3", "Float3 opMul(const Float3 &in other) const",
355  asMETHODPR(Float3, operator*,(const Float3&) const, Float3), asCALL_THISCALL) < 0) {
357  }
358 
359  // Return value isn't actually void here
360  if(engine->RegisterObjectMethod("Float3", "void opDivAssign(const float &in value)",
361  asMETHODPR(Float3, operator/=,(const float&), Float3&), asCALL_THISCALL) < 0) {
363  }
364 
365 
366  if(engine->RegisterObjectMethod("Float3", "Float3 Normalize() const",
367  asMETHOD(Float3, Normalize), asCALL_THISCALL) < 0) {
369  }
370 
371  if(engine->RegisterObjectMethod("Float3", "float HAddAbs() const",
372  asMETHOD(Float3, HAddAbs), asCALL_THISCALL) < 0) {
374  }
375 
376  if(engine->RegisterObjectMethod(
377  "Float3", "float HAdd() const", asMETHOD(Float3, HAdd), asCALL_THISCALL) < 0) {
379  }
380 
381  if(engine->RegisterObjectMethod("Float3", "float LengthSquared() const",
382  asMETHOD(Float3, LengthSquared), asCALL_THISCALL) < 0) {
384  }
385 
386  if(engine->RegisterObjectMethod("Float3", "float Dot(const Float3 &in val) const",
387  asMETHOD(Float3, Dot), asCALL_THISCALL) < 0) {
389  }
390 
391  if(engine->RegisterObjectMethod("Float3", "Float3 Cross(const Float3 &in val) const",
392  asMETHOD(Float3, Cross), asCALL_THISCALL) < 0) {
394  }
395 
396  if(engine->RegisterObjectMethod("Float3", "bool HasInvalidValues() const",
397  asMETHOD(Float3, HasInvalidValues), asCALL_THISCALL) < 0) {
399  }
400 
401  // Direct access
402  if(engine->RegisterObjectProperty("Float3", "float X", asOFFSET(Float3, X)) < 0) {
403 
405  }
406 
407  if(engine->RegisterObjectProperty("Float3", "float Y", asOFFSET(Float3, Y)) < 0) {
408 
410  }
411 
412  if(engine->RegisterObjectProperty("Float3", "float Z", asOFFSET(Float3, Z)) < 0) {
413 
415  }
416 
417 
418  // ------------------------------------ //
419  // Named ones
420  if(engine->SetDefaultNamespace("Float3") < 0) {
422  }
423 
424  if(engine->RegisterGlobalProperty("const Float3 UnitVUp", &UnitVUpProxy) < 0) {
425 
427  }
428 
429  if(engine->SetDefaultNamespace("") < 0) {
431  }
432 
433 
434 
435  return true;
436 }
void Float3ConstructorProxy(void *memory)
Definition: TypesBind.cpp:44
void Float3ConstructorProxyAll(void *memory, float x, float y, float z)
Definition: TypesBind.cpp:49
static auto UnitVUpProxy
Definition: TypesBind.cpp:199
void Float3DestructorProxy(void *memory)
Definition: TypesBind.cpp:64
void Float3ConstructorProxySingle(void *memory, float all)
Definition: TypesBind.cpp:54
void Float3ConstructorProxyCopy(void *memory, const Float3 &other)
Definition: TypesBind.cpp:59
#define ANGELSCRIPT_REGISTERFAIL
Definition: BindHelpers.h:10

◆ BindFloat4()

bool Leviathan::BindFloat4 ( asIScriptEngine *  engine)

Definition at line 438 of file TypesBind.cpp.

439 {
440 
441  // Float4
442  if(engine->RegisterObjectType("Float4", sizeof(Float4),
443  asOBJ_VALUE | asGetTypeTraits<Float4>() | asOBJ_APP_CLASS_ALLFLOATS) < 0) {
445  }
446 
447  if(engine->RegisterObjectBehaviour("Float4", asBEHAVE_CONSTRUCT, "void f()",
448  asFUNCTION(Float4ConstructorProxy), asCALL_CDECL_OBJFIRST) < 0) {
450  }
451 
452  if(engine->RegisterObjectBehaviour("Float4", asBEHAVE_CONSTRUCT, "void f(float value)",
453  asFUNCTION(Float4ConstructorProxySingle), asCALL_CDECL_OBJFIRST) < 0) {
455  }
456 
457  if(engine->RegisterObjectBehaviour("Float4", asBEHAVE_CONSTRUCT,
458  "void f(float x, float y, float z, float w)", asFUNCTION(Float4ConstructorProxyAll),
459  asCALL_CDECL_OBJFIRST) < 0) {
461  }
462 
463  if(engine->RegisterObjectBehaviour("Float4", asBEHAVE_CONSTRUCT,
464  "void f(const Float4 &in other)", asFUNCTION(Float4ConstructorProxyCopy),
465  asCALL_CDECL_OBJFIRST) < 0) {
467  }
468 
469  if(engine->RegisterObjectBehaviour("Float4", asBEHAVE_DESTRUCT, "void f()",
470  asFUNCTION(Float4DestructorProxy), asCALL_CDECL_OBJFIRST) < 0) {
472  }
473 
474  // Operators //
475  if(engine->RegisterObjectMethod("Float4", "Float4& opAssign(const Float4 &in other)",
476  asMETHODPR(Float4, operator=,(const Float4&), Float4&), asCALL_THISCALL) < 0) {
478  }
479 
480  if(engine->RegisterObjectMethod("Float4", "bool opEquals(const Float4 &in other) const",
481  asMETHODPR(Float4, operator==,(const Float4&) const, bool), asCALL_THISCALL) < 0) {
483  }
484 
485  if(engine->RegisterObjectMethod("Float4", "Float4 opAdd(const Float4 &in other) const",
486  asMETHODPR(Float4, operator+,(const Float4&) const, Float4), asCALL_THISCALL) < 0) {
488  }
489 
490  if(engine->RegisterObjectMethod("Float4", "Float4 opSub(const Float4 &in other) const",
491  asMETHODPR(Float4, operator-,(const Float4&) const, Float4), asCALL_THISCALL) < 0) {
493  }
494 
495  if(engine->RegisterObjectMethod("Float4", "Float4 opMul(float multiply) const",
496  asMETHODPR(Float4, operator*,(float) const, Float4), asCALL_THISCALL) < 0) {
498  }
499 
500  if(engine->RegisterObjectMethod("Float4", "Float4 opMul(const Float4 &in other) const",
501  asMETHODPR(Float4, operator*,(const Float4&) const, Float4), asCALL_THISCALL) < 0) {
503  }
504 
505  if(engine->RegisterObjectMethod("Float4", "Float4 Normalize() const",
506  asMETHOD(Float4, Normalize), asCALL_THISCALL) < 0) {
508  }
509 
510  if(engine->RegisterObjectMethod(
511  "Float4", "Float3 ToAxis() const", asMETHOD(Float4, ToAxis), asCALL_THISCALL) < 0) {
513  }
514 
515  if(engine->RegisterObjectMethod("Float4", "float ToAngle() const",
516  asMETHOD(Float4, ToAngle), asCALL_THISCALL) < 0) {
518  }
519 
520  if(engine->RegisterObjectMethod("Float4", "Float4 Inverse() const",
521  asMETHOD(Float4, Inverse), asCALL_THISCALL) < 0) {
523  }
524 
525  if(engine->RegisterObjectMethod("Float4",
526  "Float3 RotateVector(const Float3 &in vector) const",
527  asMETHOD(Float4, RotateVector), asCALL_THISCALL) < 0) {
529  }
530 
531  if(engine->RegisterObjectMethod("Float4",
532  "Float4 Slerp(const Float4 &in other, float fraction) const",
533  asMETHOD(Float4, Slerp), asCALL_THISCALL) < 0) {
535  }
536 
537  if(engine->RegisterObjectMethod("Float4", "bool HasInvalidValues() const",
538  asMETHOD(Float4, HasInvalidValues), asCALL_THISCALL) < 0) {
540  }
541 
542  // Direct access
543  if(engine->RegisterObjectProperty("Float4", "float X", asOFFSET(Float4, X)) < 0) {
544 
546  }
547 
548  if(engine->RegisterObjectProperty("Float4", "float Y", asOFFSET(Float4, Y)) < 0) {
549 
551  }
552 
553  if(engine->RegisterObjectProperty("Float4", "float Z", asOFFSET(Float4, Z)) < 0) {
554 
556  }
557 
558  if(engine->RegisterObjectProperty("Float4", "float W", asOFFSET(Float4, W)) < 0) {
559 
561  }
562 
563  // ------------------------------------ //
564  // Named ones
565  if(engine->SetDefaultNamespace("Float4") < 0) {
567  }
568 
569  if(engine->RegisterGlobalProperty("const Float4 IdentityQuaternion", IdentityQuaternion) <
570  0) {
571 
573  }
574 
575  if(engine->RegisterGlobalFunction(
576  "Float4 QuaternionLookAt(const Float3 &in sourcepoint, const Float3 &in target)",
577  asFUNCTION(Float4::QuaternionLookAt), asCALL_CDECL) < 0) {
578 
580  }
581 
582  if(engine->SetDefaultNamespace("") < 0) {
584  }
585 
586  return true;
587 }
Float4 IdentityQuaternion
Definition: TypesBind.cpp:15
void Float4ConstructorProxyAll(void *memory, float x, float y, float z, float w)
Definition: TypesBind.cpp:75
void Float4ConstructorProxyCopy(void *memory, const Float4 &other)
Definition: TypesBind.cpp:85
void Float4ConstructorProxy(void *memory)
Definition: TypesBind.cpp:70
void Float4ConstructorProxySingle(void *memory, float all)
Definition: TypesBind.cpp:80
#define ANGELSCRIPT_REGISTERFAIL
Definition: BindHelpers.h:10
void Float4DestructorProxy(void *memory)
Definition: TypesBind.cpp:90

◆ BindGameModule()

bool Leviathan::BindGameModule ( asIScriptEngine *  engine)

Definition at line 629 of file CommonEngineBind.cpp.

630 {
631 
633 
634  // Bind simple name get function //
635  if(engine->RegisterObjectMethod("GameModule", "string GetDescription(bool full = false)",
636  asMETHOD(GameModule, GetDescription), asCALL_THISCALL) < 0) {
638  }
639 
640 
641  return true;
642 }
#define ANGELSCRIPT_REGISTER_REF_TYPE(RegisterName, ClassName)
Definition: BindHelpers.h:90
#define ANGELSCRIPT_REGISTERFAIL
Definition: BindHelpers.h:10
Represents a scriptable part of a program.
Definition: GameModule.h:15

◆ BindGameWorldBaseMethods()

template<class WorldType >
bool Leviathan::BindGameWorldBaseMethods ( asIScriptEngine *  engine,
const char *  classname 
)

Definition at line 15 of file StandardWorldBindHelper.h.

16 {
17 
18  if(engine->RegisterObjectMethod(classname, "ObjectID CreateEntity()",
19  asMETHOD(WorldType, CreateEntity), asCALL_THISCALL) < 0) {
21  }
22 
23  // Use this rather than DestroyEntity
24  if(engine->RegisterObjectMethod(classname, "void QueueDestroyEntity(ObjectID id)",
25  asMETHOD(WorldType, QueueDestroyEntity), asCALL_THISCALL) < 0) {
27  }
28 
29  if(engine->RegisterObjectMethod(classname, "bool DestroyEntity(ObjectID id)",
30  asMETHOD(WorldType, DestroyEntity), asCALL_THISCALL) < 0) {
32  }
33 
34  if(engine->RegisterObjectMethod(classname,
35  "void SetEntitysParent(ObjectID child, ObjectID parent)",
36  asMETHOD(WorldType, SetEntitysParent), asCALL_THISCALL) < 0) {
38  }
39 
40  if(engine->RegisterObjectMethod(classname, "PhysicalWorld@ GetPhysicalWorld()",
41  asMETHOD(WorldType, GetPhysicalWorld), asCALL_THISCALL) < 0) {
43  }
44 
45  if(engine->RegisterObjectMethod(classname,
46  "int GetPhysicalMaterial(const string &in name)",
47  asMETHOD(WorldType, GetPhysicalMaterial), asCALL_THISCALL) < 0) {
49  }
50 
51  if(engine->RegisterObjectMethod(classname,
52  "RayCastHitEntity@ CastRayGetFirstHit(Float3 start, Float3 end)",
53  asMETHOD(WorldType, CastRayGetFirstHitProxy), asCALL_THISCALL) < 0) {
55  }
56 
57  // ------------------------------------ //
58  // Support for script types
59  if(engine->RegisterObjectMethod(classname,
60  "array<ObjectID>@ GetRemovedIDsForComponents(array<uint16>@ componenttypes)",
61  asMETHOD(WorldType, GetRemovedIDsForComponents), asCALL_THISCALL) < 0) {
63  }
64 
65  if(engine->RegisterObjectMethod(classname,
66  "array<ObjectID>@ GetRemovedIDsForScriptComponents(array<string>@ typenames)",
67  asMETHOD(WorldType, GetRemovedIDsForScriptComponents), asCALL_THISCALL) < 0) {
69  }
70 
71  if(engine->RegisterObjectMethod(classname,
72  "bool RegisterScriptComponentType(const string &in name, ComponentFactoryFunc@ "
73  "factory)",
74  asMETHOD(WorldType, RegisterScriptComponentType), asCALL_THISCALL) < 0) {
76  }
77 
78  if(engine->RegisterObjectMethod(classname,
79  "bool RegisterScriptSystem(const string &in name, ScriptSystem@ systemobject)",
80  asMETHOD(WorldType, RegisterScriptSystem), asCALL_THISCALL) < 0) {
82  }
83 
84  if(engine->RegisterObjectMethod(classname,
85  "ScriptComponentHolder@ GetScriptComponentHolder(const string &in name)",
86  asMETHOD(WorldType, GetScriptComponentHolder), asCALL_THISCALL) < 0) {
88  }
89 
90  if(engine->RegisterObjectMethod(classname,
91  "ScriptSystem@ GetScriptSystem(const string &in name)",
92  asMETHOD(WorldType, GetScriptSystem), asCALL_THISCALL) < 0) {
94  }
95 
96  // ------------------------------------ //
97  // Somewhat questionable Ogre shortcuts that should probably be component types
98  if(engine->RegisterObjectMethod(classname, "void SetSunlight()",
99  asMETHOD(WorldType, SetSunlight), asCALL_THISCALL) < 0) {
101  }
102 
103  if(engine->RegisterObjectMethod(classname, "void RemoveSunlight()",
104  asMETHOD(WorldType, RemoveSunlight), asCALL_THISCALL) < 0) {
106  }
107 
108  if(engine->RegisterObjectMethod(classname,
109  "void SetLightProperties(const Ogre::ColourValue &in diffuse, const "
110  "Ogre::ColourValue &in specular, const Ogre::Vector3 &in direction, float power, "
111  "const Ogre::ColourValue &in upperhemisphere, const Ogre::ColourValue &in "
112  "lowerhemisphere, const Ogre::Vector3 &in hemispheredir, float envmapscale = 1.0f)",
113  asMETHOD(WorldType, SetLightProperties), asCALL_THISCALL) < 0) {
115  }
116 
117  // ------------------------------------ //
118  // These are inefficient versions of the get methods, prefer the ones in derived classes
119  if(engine->RegisterObjectMethod(classname,
120  "Physics@ BaseWorldGetComponentPhysics(ObjectID id)",
121  asMETHODPR(WorldType, template GetComponent<Physics>, (ObjectID), Physics&),
122  asCALL_THISCALL) < 0) {
124  }
125 
126  if(engine->RegisterObjectMethod(classname,
127  "Position@ BaseWorldGetComponentPosition(ObjectID id)",
128  asMETHODPR(WorldType, template GetComponent<Position>, (ObjectID), Position&),
129  asCALL_THISCALL) < 0) {
131  }
132 
133  return true;
134 }
int32_t ObjectID
Definition: EntityCommon.h:11
#define ANGELSCRIPT_REGISTERFAIL
Definition: BindHelpers.h:10

◆ BindGUI()

bool Leviathan::BindGUI ( asIScriptEngine *  engine)

Definition at line 25 of file GuiScriptBind.cpp.

26 {
27  // GuiManager needed to use some functionality, registered so that it cannot be stored //
28  if(engine->RegisterObjectType("GuiManager", 0, asOBJ_REF | asOBJ_NOHANDLE) < 0) {
30  }
31 
32  return true;
33 }
#define ANGELSCRIPT_REGISTERFAIL
Definition: BindHelpers.h:10

◆ BindInt2()

bool Leviathan::BindInt2 ( asIScriptEngine *  engine)

Definition at line 589 of file TypesBind.cpp.

590 {
591 
592  if(engine->RegisterObjectType("Int2", sizeof(Int2),
593  asOBJ_VALUE | asGetTypeTraits<Int2>() | asOBJ_APP_CLASS_ALLINTS) < 0) {
595  }
596  if(engine->RegisterObjectBehaviour("Int2", asBEHAVE_CONSTRUCT, "void f()",
597  asFUNCTION(Int2ConstructorProxy), asCALL_CDECL_OBJFIRST) < 0) {
599  }
600  if(engine->RegisterObjectBehaviour("Int2", asBEHAVE_CONSTRUCT, "void f(int value)",
601  asFUNCTION(Int2ConstructorProxySingle), asCALL_CDECL_OBJFIRST) < 0) {
603  }
604  if(engine->RegisterObjectBehaviour("Int2", asBEHAVE_CONSTRUCT, "void f(int x, int y)",
605  asFUNCTION(Int2ConstructorProxyAll), asCALL_CDECL_OBJFIRST) < 0) {
607  }
608  if(engine->RegisterObjectBehaviour("Int2", asBEHAVE_CONSTRUCT,
609  "void f(const Int2 &in other)", asFUNCTION(Int2ConstructorProxyCopy),
610  asCALL_CDECL_OBJFIRST) < 0) {
612  }
613  if(engine->RegisterObjectBehaviour("Int2", asBEHAVE_DESTRUCT, "void f()",
614  asFUNCTION(Int2DestructorProxy), asCALL_CDECL_OBJFIRST) < 0) {
616  }
617 
618  if(engine->RegisterObjectBehaviour("Int2", asBEHAVE_LIST_CONSTRUCT,
619  "void f(const int &in) {int, int}", asFUNCTION(Int2ListConstructor),
620  asCALL_CDECL_OBJFIRST) < 0) {
622  }
623 
624  // Operators //
625  if(engine->RegisterObjectMethod("Int2", "Int2& opAssign(const Int2 &in other)",
626  asMETHODPR(Int2, operator=,(const Int2&), Int2&), asCALL_THISCALL) < 0) {
628  }
629 
630  if(engine->RegisterObjectMethod("Int2", "Int2 opAdd(const Int2 &in other) const",
631  asMETHODPR(Int2, operator+,(const Int2&) const, Int2), asCALL_THISCALL) < 0) {
633  }
634 
635  if(engine->RegisterObjectMethod("Int2", "Int2 opSub(const Int2 &in other) const",
636  asMETHODPR(Int2, operator-,(const Int2&) const, Int2), asCALL_THISCALL) < 0) {
638  }
639 
640  if(engine->RegisterObjectMethod("Int2", "Int2 opMul(int multiply) const",
641  asMETHODPR(Int2, operator*,(int) const, Int2), asCALL_THISCALL) < 0) {
643  }
644 
645  // Direct access
646  if(engine->RegisterObjectProperty("Int2", "int X", asOFFSET(Int2, X)) < 0) {
647 
649  }
650 
651  if(engine->RegisterObjectProperty("Int2", "int Y", asOFFSET(Int2, Y)) < 0) {
652 
654  }
655 
656  return true;
657 }
void Int2DestructorProxy(void *memory)
Definition: TypesBind.cpp:121
void Int2ConstructorProxySingle(void *memory, int all)
Definition: TypesBind.cpp:106
void Int2ConstructorProxyAll(void *memory, int x, int y)
Definition: TypesBind.cpp:101
#define ANGELSCRIPT_REGISTERFAIL
Definition: BindHelpers.h:10
void Int2ListConstructor(void *memory, int *list)
Definition: TypesBind.cpp:116
void Int2ConstructorProxy(void *memory)
Definition: TypesBind.cpp:96
void Int2ConstructorProxyCopy(void *memory, const Int2 &other)
Definition: TypesBind.cpp:111

◆ BindInt3()

bool Leviathan::BindInt3 ( asIScriptEngine *  engine)

Definition at line 659 of file TypesBind.cpp.

660 {
661 
662  if(engine->RegisterObjectType("Int3", sizeof(Int3),
663  asOBJ_VALUE | asGetTypeTraits<Int3>() | asOBJ_APP_CLASS_ALLINTS) < 0) {
665  }
666  if(engine->RegisterObjectBehaviour("Int3", asBEHAVE_CONSTRUCT, "void f()",
667  asFUNCTION(Int3ConstructorProxy), asCALL_CDECL_OBJFIRST) < 0) {
669  }
670  if(engine->RegisterObjectBehaviour("Int3", asBEHAVE_CONSTRUCT, "void f(int value)",
671  asFUNCTION(Int3ConstructorProxySingle), asCALL_CDECL_OBJFIRST) < 0) {
673  }
674  if(engine->RegisterObjectBehaviour("Int3", asBEHAVE_CONSTRUCT,
675  "void f(int x, int y, int z)", asFUNCTION(Int3ConstructorProxyAll),
676  asCALL_CDECL_OBJFIRST) < 0) {
678  }
679  if(engine->RegisterObjectBehaviour("Int3", asBEHAVE_CONSTRUCT,
680  "void f(const Int3 &in other)", asFUNCTION(Int3ConstructorProxyCopy),
681  asCALL_CDECL_OBJFIRST) < 0) {
683  }
684  if(engine->RegisterObjectBehaviour("Int3", asBEHAVE_DESTRUCT, "void f()",
685  asFUNCTION(Int3DestructorProxy), asCALL_CDECL_OBJFIRST) < 0) {
687  }
688  // Operators //
689  if(engine->RegisterObjectMethod("Int3", "Int3& opAssign(const Int3 &in other)",
690  asMETHODPR(Int3, operator=,(const Int3&), Int3&), asCALL_THISCALL) < 0) {
692  }
693 
694  if(engine->RegisterObjectMethod("Int3", "Int3 opAdd(const Int3 &in other) const",
695  asMETHODPR(Int3, operator+,(const Int3&) const, Int3), asCALL_THISCALL) < 0) {
697  }
698 
699  if(engine->RegisterObjectMethod("Int3", "Int3 opSub(const Int3 &in other) const",
700  asMETHODPR(Int3, operator-,(const Int3&) const, Int3), asCALL_THISCALL) < 0) {
702  }
703 
704  if(engine->RegisterObjectMethod("Int3", "Int3 opMul(int multiply) const",
705  asMETHODPR(Int3, operator*,(int) const, Int3), asCALL_THISCALL) < 0) {
707  }
708 
709  // Direct access
710  if(engine->RegisterObjectProperty("Int3", "int X", asOFFSET(Int3, X)) < 0) {
711 
713  }
714 
715  if(engine->RegisterObjectProperty("Int3", "int Y", asOFFSET(Int3, Y)) < 0) {
716 
718  }
719 
720  if(engine->RegisterObjectProperty("Int3", "int Z", asOFFSET(Int3, Z)) < 0) {
721 
723  }
724 
725  return true;
726 }
void Int3ConstructorProxy(void *memory)
Definition: TypesBind.cpp:127
void Int3DestructorProxy(void *memory)
Definition: TypesBind.cpp:147
void Int3ConstructorProxyAll(void *memory, int x, int y, int z)
Definition: TypesBind.cpp:132
void Int3ConstructorProxySingle(void *memory, int all)
Definition: TypesBind.cpp:137
#define ANGELSCRIPT_REGISTERFAIL
Definition: BindHelpers.h:10
void Int3ConstructorProxyCopy(void *memory, const Int3 &other)
Definition: TypesBind.cpp:142

◆ BindMathOperations()

bool Leviathan::BindMathOperations ( asIScriptEngine *  engine)

Definition at line 65 of file BindStandardFunctions.cpp.

66 {
67 
68  // ------------------------------------ //
69  // min
70  if(engine->RegisterGlobalFunction(
71  "const float & min(const float &in a, const float &in b)",
72  asFUNCTIONPR(std::min<float>, (const float&, const float&), const float&),
73  asCALL_CDECL) < 0) {
74 
76  }
77 
78  if(engine->RegisterGlobalFunction(
79  "const int64 & min(const int64 &in a, const int64 &in b)",
80  asFUNCTIONPR(std::min<int64_t>, (const int64_t&, const int64_t&), const int64_t&),
81  asCALL_CDECL) < 0) {
82 
84  }
85 
86  // ------------------------------------ //
87  // max
88  if(engine->RegisterGlobalFunction(
89  "const float & max(const float &in a, const float &in b)",
90  asFUNCTIONPR(std::max<float>, (const float&, const float&), const float&),
91  asCALL_CDECL) < 0) {
92 
94  }
95 
96  if(engine->RegisterGlobalFunction(
97  "const int64 & max(const int64 &in a, const int64 &in b)",
98  asFUNCTIONPR(std::max<int64_t>, (const int64_t&, const int64_t&), const int64_t&),
99  asCALL_CDECL) < 0) {
100 
102  }
103 
104  // ------------------------------------ //
105  // round
106  if(engine->RegisterGlobalFunction(
107  "int round(double value)", asFUNCTION(RoundProxy), asCALL_CDECL) < 0) {
108 
110  }
111  if(engine->RegisterGlobalFunction(
112  "int round(float value)", asFUNCTION(RoundProxy2), asCALL_CDECL) < 0) {
113 
115  }
116 
117  // ------------------------------------ //
118  // sign
119  if(engine->RegisterGlobalFunction(
120  "float sign(float value)", asFUNCTION(SignProxy), asCALL_CDECL) < 0) {
121 
123  }
124 
125 
126  // ------------------------------------ //
127  // Extra string helpers
128  if(engine->RegisterGlobalFunction("string CharacterToString(int32 character)",
129  asFUNCTION(CharacterToStringProxy), asCALL_CDECL) < 0) {
130 
132  }
133 
134 
135  return true;
136 }
float SignProxy(float value)
std::string CharacterToStringProxy(int32_t character)
int RoundProxy(double value)
int RoundProxy2(float value)
#define ANGELSCRIPT_REGISTERFAIL
Definition: BindHelpers.h:10

◆ BindMatrix4()

bool Leviathan::BindMatrix4 ( asIScriptEngine *  engine)

Definition at line 294 of file OgreBind.cpp.

295 {
296 
297  if(engine->RegisterObjectType("Matrix4", sizeof(Ogre::Matrix4),
298  asOBJ_VALUE | asGetTypeTraits<Ogre::Matrix4>() | asOBJ_POD |
299  asOBJ_APP_CLASS_ALLFLOATS) < 0) {
301  }
302 
303  if(engine->RegisterObjectBehaviour("Matrix4", asBEHAVE_CONSTRUCT,
304  "void f(const Vector3 &in trans, const Vector3 &in scale = Ogre::Vector3(1, 1, 1), "
305  "const Quaternion &in orientation = Ogre::Quaternion::IDENTITY)",
306  asFUNCTION(MatrixProxy), asCALL_CDECL_OBJFIRST) < 0) {
308  }
309 
310  if(engine->RegisterObjectMethod("Matrix4",
311  "void makeTransform(const Vector3 &in trans, const Vector3 &in scale = "
312  "Ogre::Vector3(1, 1, 1), const Quaternion &in orientation = "
313  "Ogre::Quaternion::IDENTITY)",
314  asMETHOD(Ogre::Matrix4, makeTransform), asCALL_THISCALL) < 0) {
316  }
317 
318  if(engine->RegisterObjectMethod("Matrix4", "Vector3 getTrans() const",
319  asMETHODPR(Ogre::Matrix4, getTrans, () const, Ogre::Vector3),
320  asCALL_THISCALL) < 0) {
322  }
323 
324 
325  if(engine->RegisterObjectMethod("Matrix4", "Quaternion extractQuaternion() const",
326  asMETHOD(Ogre::Matrix4, extractQuaternion), asCALL_THISCALL) < 0) {
328  }
329 
330 
331 
332  if(engine->SetDefaultNamespace("Ogre::Matrix4") < 0) {
334  }
335 
336  if(engine->RegisterGlobalProperty("const Ogre::Matrix4 IDENTITY",
337  const_cast<Ogre::Matrix4*>(&Ogre::Matrix4::IDENTITY)) < 0) {
339  }
340 
341  if(engine->SetDefaultNamespace("Ogre") < 0) {
343  }
344 
345 
346  return true;
347 }
void MatrixProxy(void *memory, const Ogre::Vector3 &position, const Ogre::Vector3 &scale, const Ogre::Quaternion &orientation)
Definition: OgreBind.cpp:32
#define ANGELSCRIPT_REGISTERFAIL
Definition: BindHelpers.h:10

◆ BindMeshes()

bool Leviathan::BindMeshes ( asIScriptEngine *  engine)

Definition at line 602 of file OgreBind.cpp.

603 {
604  // ------------------------------------ //
605  // Mesh
606  if(engine->RegisterObjectType("Mesh", 0, asOBJ_REF | asOBJ_NOCOUNT) < 0) {
608  }
609 
610  if(engine->RegisterObjectMethod("Mesh", "string getName()", asFUNCTION(MeshGetNameProxy),
611  asCALL_CDECL_OBJFIRST) < 0) {
613  }
614 
615 
616  return true;
617 }
std::string MeshGetNameProxy(Ogre::Mesh *self)
Definition: OgreBind.cpp:137
#define ANGELSCRIPT_REGISTERFAIL
Definition: BindHelpers.h:10

◆ BindNamedVars()

bool Leviathan::BindNamedVars ( asIScriptEngine *  engine)
Todo:
make this safe to be passed to the script

Definition at line 254 of file CommonEngineBind.cpp.

255 {
256 
258 
259  if(!BindDataBlock(engine))
260  return false;
261 
262  if(engine->RegisterObjectBehaviour("NamedVars", asBEHAVE_FACTORY, "NamedVars@ f()",
263  asFUNCTION(NamedVarsFactory), asCALL_CDECL) < 0) {
265  }
266 
267  if(engine->RegisterObjectMethod("NamedVars",
268  "ScriptSafeVariableBlock@ GetSingleValueByName(const string &in name)",
269  asMETHOD(NamedVars, GetScriptCompatibleValue), asCALL_THISCALL) < 0) {
271  }
272 
273  if(engine->RegisterObjectMethod("NamedVars",
274  "bool AddValue(ScriptSafeVariableBlock@ value)",
275  asMETHOD(NamedVars, AddScriptCompatibleValue), asCALL_THISCALL) < 0) {
277  }
278 
279  if(engine->RegisterObjectMethod("NamedVars",
280  "string Serialize(const string &in lineprefix = "
281  ") const",
282  asMETHOD(NamedVars, Serialize), asCALL_THISCALL) < 0) {
284  }
285 
286  return true;
287 }
bool BindDataBlock(asIScriptEngine *engine)
#define ANGELSCRIPT_REGISTER_REF_TYPE(RegisterName, ClassName)
Definition: BindHelpers.h:90
#define ANGELSCRIPT_REGISTERFAIL
Definition: BindHelpers.h:10
static NamedVars * NamedVarsFactory()

◆ BindNewton()

bool Leviathan::BindNewton ( asIScriptEngine *  engine)

Definition at line 57 of file NewtonBind.cpp.

58 {
59 
60  if(!BindNewtonTypes(engine))
61  return false;
62 
63  // These classes are Leviathan classes so these should not be in the newton namespace
64  if(engine->RegisterObjectType("PhysicalWorld", 0, asOBJ_REF | asOBJ_NOCOUNT) < 0) {
66  }
67 
68  // TODO: should these be somehow reference counted?
69  if(engine->RegisterObjectMethod("PhysicalWorld",
70  "void DestroyCollision(NewtonCollision@ collision)",
71  asMETHOD(PhysicalWorld, DestroyCollision), asCALL_THISCALL) < 0) {
73  }
74 
75  if(engine->RegisterObjectMethod("PhysicalWorld",
76  "NewtonCollision@ CreateCompoundCollision()",
77  asMETHOD(PhysicalWorld, CreateCompoundCollision), asCALL_THISCALL) < 0) {
79  }
80 
81  if(engine->RegisterObjectMethod("PhysicalWorld",
82  "NewtonCollision@ CreateSphere(float radius, const Ogre::Matrix4 &in offset = "
83  "Ogre::Matrix4::IDENTITY)",
84  asMETHOD(PhysicalWorld, CreateSphere), asCALL_THISCALL) < 0) {
86  }
87 
88  // ------------------------------------ //
89  if(engine->RegisterObjectMethod("PhysicalWorld",
90  "NewtonBody@ CreateBodyFromCollision(NewtonCollision@ collision)",
91  asMETHOD(PhysicalWorld, CreateBodyFromCollision), asCALL_THISCALL) < 0) {
93  }
94 
95  if(engine->RegisterObjectMethod("PhysicalWorld", "void DestroyBody(NewtonBody@ body)",
96  asMETHOD(PhysicalWorld, DestroyBody), asCALL_THISCALL) < 0) {
98  }
99 
100 
101  return true;
102 }
bool BindNewtonTypes(asIScriptEngine *engine)
Definition: NewtonBind.cpp:19
#define ANGELSCRIPT_REGISTERFAIL
Definition: BindHelpers.h:10

◆ BindNewtonTypes()

bool Leviathan::BindNewtonTypes ( asIScriptEngine *  engine)

Definition at line 19 of file NewtonBind.cpp.

20 {
21  if(engine->RegisterObjectType("NewtonCollision", 0, asOBJ_REF | asOBJ_NOCOUNT) < 0) {
23  }
24 
25  if(engine->RegisterObjectMethod("NewtonCollision",
26  "void CompoundCollisionBeginAddRemove()",
27  asFUNCTION(NewtonCompoundCollisionBeginAddRemove), asCALL_CDECL_OBJFIRST) < 0) {
29  }
30 
31  if(engine->RegisterObjectMethod("NewtonCollision", "void CompoundCollisionEndAddRemove()",
32  asFUNCTION(NewtonCompoundCollisionEndAddRemove), asCALL_CDECL_OBJFIRST) < 0) {
34  }
35 
36  if(engine->RegisterObjectMethod("NewtonCollision",
37  "void CompoundCollisionAddSubCollision(NewtonCollision@ convexCollision)",
38  asFUNCTION(NewtonCompoundCollisionAddSubCollision), asCALL_CDECL_OBJFIRST) < 0) {
40  }
41 
42  if(engine->RegisterObjectMethod("NewtonCollision",
43  "void CompoundCollisionRemoveSubCollision(NewtonCollision@ convexCollision)",
44  asFUNCTION(NewtonCompoundCollisionRemoveSubCollision), asCALL_CDECL_OBJFIRST) < 0) {
46  }
47 
48 
49  if(engine->RegisterObjectType("NewtonBody", 0, asOBJ_REF | asOBJ_NOCOUNT) < 0) {
51  }
52 
53  return true;
54 }
#define ANGELSCRIPT_REGISTERFAIL
Definition: BindHelpers.h:10

◆ BindOgre()

bool Leviathan::BindOgre ( asIScriptEngine *  engine)

Definition at line 621 of file OgreBind.cpp.

622 {
623 
624  // This doesn't need to be restored if we fail //
625  if(engine->SetDefaultNamespace("Ogre") < 0) {
627  }
628 
629  if(!BindOgreTypeDefs(engine))
630  return false;
631 
632  if(!BindVector3(engine))
633  return false;
634 
635  if(!BindVector4(engine))
636  return false;
637