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

 Editor
 
 GUI
 
 KeyMapping
 
 MMath
 
 Script
 
 Sound
 
 Test
 

Classes

struct  AngelScriptTypeIDResolver
 
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  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
 Prints a warning or an error once. More...
 
class  Component
 Base class for all components. More...
 
class  ComponentHolder
 
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  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  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  EntityState
 Holder of state for a whole entity. 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  GameModuleLoader
 Manages loading GameModule objects to make sure that each is loaded only once. 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  InbuiltWorldFactory
 Factory for inbuilt world types. More...
 
class  InputController
 Manages registering multiple InputReceiver objects to a window to easily control where input is sent. More...
 
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  LeviathanPhysicsOverlapFilter
 Handles AABB material callbacks. 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  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  NonOwningScriptCallback
 A helper for keeping a weak reference to a script delegate or function. More...
 
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
 Holds state objects of type StateT related to a single entity. More...
 
class  OutOfMemoryHandler
 
class  PermissionsGroup
 
class  PermissionsManager
 
class  PermissionsNode
 
class  PermissionsPlayer
 
class  PhysicalMaterial
 
class  PhysicalWorld
 
class  Physics
 Entity has a physical component. More...
 
class  PhysicsBody
 This is an instance of a collision body. More...
 
class  PhysicsDataBridge
 This is an indirection helper for allowing world entities to detach from physics objects if they get destroyed. More...
 
class  PhysicsMaterialManager
 Contains a material list for applying automatic properties to PhysicsBody and collision callbacks. More...
 
class  PhysicsPositionProvider
 This acts as a bridge between Leviathan positions and physics engine positions. More...
 
class  PhysicsShape
 A physical shape that can be used to create PhysicsBody objects. More...
 
struct  PhysMaterialDataPair
 Defines properties between two materials. More...
 
class  Plane
 Plane component. More...
 
class  Position
 Entity has position and direction it is looking at. 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...
 
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  ScriptComponentState
 Class for supporting script defined component states. More...
 
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  SendableMarkFromSystem
 System type for marking Sendable as marked if a component of type T is marked. 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  SingleSystem
 Base class for systems that use a single component directly. More...
 
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  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  ThisPointerTypeChecker
 This can check the "this" pointer that the class' constructor was called on it. More...
 
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
 
struct  WorldNetworkSettings
 

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 PhysicsMaterialAABBCallback = bool(*)(PhysicalWorld &world, PhysicsBody &, PhysicsBody &)
 
using PhysicsMaterialContactCallback = void(*)(PhysicalWorld &world, PhysicsBody &, PhysicsBody &)
 
using AccessFlags = uint32_t
 

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  INBUILT_WORLD_TYPE : int32_t { INBUILT_WORLD_TYPE::Standard = 1024 }
 Types of inbuilt world types. 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_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::InvalidParameters, 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, SERVER_ACCEPTED_TYPE::Done }
 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::JoinGame, 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::StartWorldReceive, NETWORK_RESPONSE_TYPE::EntityCreation,
  NETWORK_RESPONSE_TYPE::EntityUpdate, NETWORK_RESPONSE_TYPE::EntityDestruction, NETWORK_RESPONSE_TYPE::EntityLocalControlStatus, NETWORK_RESPONSE_TYPE::CacheUpdated,
  NETWORK_RESPONSE_TYPE::CacheRemoved, NETWORK_RESPONSE_TYPE::WorldFrozen, NETWORK_RESPONSE_TYPE::ServerHeartbeat, NETWORK_RESPONSE_TYPE::StartHeartbeats,
  NETWORK_RESPONSE_TYPE::None, NETWORK_RESPONSE_TYPE::Custom
}
 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 std::string_view GetMimeTypeFromPath (const std::string_view &path)
 This returns a mime type based on the file extension. More...
 
DLLEXPORT sf::Packet & operator<< (sf::Packet &packet, const Float2 &data)
 
DLLEXPORT sf::Packet & operator>> (sf::Packet &packet, Float2 &data)
 
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, const sf::Packet &packetinner)
 
DLLEXPORT sf::Packet & operator>> (sf::Packet &packet, sf::Packet &packetinner)
 
DLLEXPORT sf::Packet & operator<< (sf::Packet &packet, const Ogre::Vector3 &data)
 
DLLEXPORT sf::Packet & operator>> (sf::Packet &packet, Ogre::Vector3 &data)
 
DLLEXPORT sf::Packet & operator<< (sf::Packet &packet, const Ogre::Plane &data)
 
DLLEXPORT sf::Packet & operator>> (sf::Packet &packet, Ogre::Plane &data)
 
void ThrowIfMatrixIsNotOrthogonal (const Ogre::Matrix4 &matrix, float tol=1.0e-4f)
 Newton compatible matrix orthogonal check. More...
 
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...
 
DLLEXPORT void JSArrayToList (const CefRefPtr< CefV8Value > &source, const CefRefPtr< CefListValue > &target)
 Converts a JS array to list value. More...
 
DLLEXPORT void JSObjectToDictionary (const CefRefPtr< CefV8Value > &source, const CefRefPtr< CefDictionaryValue > &target)
 Takes a JS object and makes it into a dictionary for sending between processes. More...
 
template<class SourceT , class KeyT >
std::unique_ptr< DataBlockAllHandleSimpleVar (CefValueType type, const CefRefPtr< SourceT > &source, const KeyT &key)
 
DLLEXPORT void CEFDictionaryToNamedVars (const CefRefPtr< CefDictionaryValue > &source, NamedVars &destination)
 Converts CEF dictionary to NamedVars. 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...
 
template<typename KeyType >
bool MatchesAnyKeyInSet (const std::vector< Key< KeyType >> keys, const KeyType &chara, const short &additional, bool strict=false)
 Helper for checking multiple keys. More...
 
void RunGetResponseFromMaster (NetworkHandler *instance, std::shared_ptr< std::promise< std::string >> resultvar)
 
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 BindWindow (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 BindOgreTypeDefs (asIScriptEngine *engine)
 
bool BindVector3 (asIScriptEngine *engine)
 
bool BindVector4 (asIScriptEngine *engine)
 
bool BindColour (asIScriptEngine *engine)
 
bool BindMatrix4 (asIScriptEngine *engine)
 
bool BindAnglesAndQuaternion (asIScriptEngine *engine)
 
bool BindPlane (asIScriptEngine *engine)
 
bool BindRay (asIScriptEngine *engine)
 
bool BindRenderQueue (asIScriptEngine *engine)
 
bool BindScene (asIScriptEngine *engine)
 
bool BindSkeletons (asIScriptEngine *engine)
 
bool BindMeshes (asIScriptEngine *engine)
 
bool BindOgre (asIScriptEngine *engine)
 
bool BindShape (asIScriptEngine *engine)
 
bool BindBody (asIScriptEngine *engine)
 
bool BindPhysics (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)
 
asIScriptContext * RequestContextCallback (asIScriptEngine *engine, void *userdata)
 
void ReturnContextCallback (asIScriptEngine *engine, asIScriptContext *context, void *userdata)
 
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 PHYSICS_BASE_GRAVITY = -9.81f
 
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...
 

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 260 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 16 of file ThreadSafe.h.

◆ Mutex

using Leviathan::Mutex = typedef std::mutex

Definition at line 14 of file ThreadSafe.h.

◆ ObjectID

using Leviathan::ObjectID = typedef int32_t

Definition at line 11 of file EntityCommon.h.

◆ PhysicsMaterialAABBCallback

This callback is called first when the bounding boxes of 2 bodies touch. This can be used then to disable the collision or allow the collision. After this has run if the bodies actually hit each other PhysicsMaterialContactCallback will be called once for each touching point. If no fine grained hit detection is needed this can also be used for that. Returning false disables the collision between the objects. Returning true enables the collision

Definition at line 22 of file PhysicalMaterial.h.

◆ PhysicsMaterialContactCallback

This function is called every time an actual collision occurs between objects for each collision point between the materials. This is recommended to be used for playing sound effects and other fine grained hit detection.

Definition at line 30 of file PhysicalMaterial.h.

◆ RecursiveLock

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

Definition at line 17 of file ThreadSafe.h.

◆ RecursiveMutex

using Leviathan::RecursiveMutex = typedef std::recursive_mutex

Definition at line 15 of file ThreadSafe.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 148 of file ThreadSafe.h.

◆ ThreadSafeRecursive

Object supports recursive locking.

Less efficient than ThreadSafe

Definition at line 153 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.

◆ CONNECTION_RESTRICTION

Allows restricting connections to allow only certain packets.

Enumerator
None 
ReceiveRemoteConsole 

Definition at line 63 of file Connection.h.

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 69 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 48 of file StringIterator.h.

◆ EQUALITYCHARACTER

Enumerator
EQUALITYCHARACTER_TYPE_EQUALITY 
EQUALITYCHARACTER_TYPE_DOUBLEDOTSTYLE 
EQUALITYCHARACTER_TYPE_ALL 

Definition at line 64 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_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,
41 
43 };

◆ FILEGROUP

Enumerator
FILEGROUP_MODEL 
FILEGROUP_TEXTURE 
FILEGROUP_SOUND 
FILEGROUP_SCRIPT 
FILEGROUP_OTHER 

Definition at line 15 of file FileSystem.h.

◆ INBUILT_WORLD_TYPE

enum Leviathan::INBUILT_WORLD_TYPE : int32_t
strong

Types of inbuilt world types.

Enumerator
Standard 

Definition at line 37 of file GameWorldFactory.h.

◆ ITERATORCALLBACK_RETURNTYPE

Enumerator
ITERATORCALLBACK_RETURNTYPE_STOP 
ITERATORCALLBACK_RETURNTYPE_CONTINUE 

Definition at line 70 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 90 of file StringIterator.h.

90  {
91 
94 
106 
110 
114 
129 };
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

JoinGame 

Client requests to join active gamestate (if the options is not empty then the client is asking to join something specific)

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 16 of file NetworkRequest.h.

16  : uint16_t {
17 
19  Connect,
20 
22  Security,
23 
27 
31 
33 
35 
37 
39 
42 
45  JoinServer,
46 
49  JoinGame,
50 
52 
54 
58 
61 
63  Echo,
64 
73 
75  Custom
76 };
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.

InvalidParameters 

The client has made a request with invalid or unsupported options.

ServerCustom 

The server has used a custom rule to disallow this.

Definition at line 105 of file CommonNetwork.h.

105  : uint8_t {
106 
110 
113  Unsupported,
114 
116  ServerFull,
117 
120 
124 
127 
130 
133 };
The server has used a custom rule to disallow this.
unsigned char uint8_t
Definition: core.h:38
The client has already connected to the server, and must disconnect before trying again...
The client has made a request with invalid or unsupported options.
Server has maximum number of players.

◆ 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.

StartWorldReceive 

Contains information about a world that is about to be sent to the client.

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.

EntityLocalControlStatus 

Grants or revokes local control from a client (this is used to notify the clients what is the status)

CacheUpdated 

Contains an updated cache variable.

CacheRemoved 

Contains the name of a removed cache variable.

WorldFrozen 

Sent when the server changes physics frozen state.

ServerHeartbeat 

A server heartbeat packet.

StartHeartbeats 

Marks that the client is required to send heartbeats.

None 

Empty response, used for keeping alive/nothing.

Custom 

The packet is a game specific packet!

See also
GameSpecificPacketHandler BaseGameSpecificFactory BaseGameSpecificResponsePacket

Definition at line 18 of file NetworkResponse.h.

18  : uint16_t {
19 
21  Connect,
22 
25  Security,
26 
29 
33 
35  Keepalive,
36 
40 
42 
44 
46 
49 
52 
69 
72 
76 
79 
82 
85 
88 
91 
94 
100  EntityUpdate,
101 
104 
108 
110  CacheUpdated,
111 
113  CacheRemoved,
114 
115  // //! Instructs a world to create or destroy a constraint
116  // //! Create When false the constraint is to be deleted
117  // EntityConstraint,
118 
120  WorldFrozen,
121 
124 
127 
129  None,
130 
133  Custom
134 };
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 information about a world that is about to be sent to the client.
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) This is for debugging purposes to make sure that packet numbers and message numbers aren't used interchangeably anywhere Fail reason for ConnectionInfo::CalculateNetworkPing

Enumerator
LossTooHigh 
ConnectionClosed 

Definition at line 56 of file Connection.h.

◆ QUOTETYPE

Enumerator
QUOTETYPE_DOUBLEQUOTES 
QUOTETYPE_SINGLEQUOTES 
QUOTETYPE_BOTH 

Definition at line 46 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.

Done 

The request is done.

Definition at line 136 of file CommonNetwork.h.

136  : uint8_t {
137 
140 
143 
145  Done
146 };
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 76 of file StringIterator.h.

76  {
77 
79  // SPECIAL_ITERATOR_ONNEWLINE_WHITESPACE = 0x8,
82 };
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 55 of file StringIterator.h.

Function Documentation

◆ BindAnglesAndQuaternion()

bool Leviathan::BindAnglesAndQuaternion ( asIScriptEngine *  engine)

Definition at line 402 of file OgreBind.cpp.

403 {
404  if(engine->RegisterObjectType("Radian", sizeof(Ogre::Radian),
405  asOBJ_VALUE | asGetTypeTraits<Ogre::Radian>() | asOBJ_POD |
406  asOBJ_APP_CLASS_ALLFLOATS) < 0) {
408  }
409 
410  if(engine->RegisterObjectType("Degree", sizeof(Ogre::Degree),
411  asOBJ_VALUE | asGetTypeTraits<Ogre::Degree>() | asOBJ_POD |
412  asOBJ_APP_CLASS_ALLFLOATS) < 0) {
414  }
415 
416  if(engine->RegisterObjectType("Quaternion", sizeof(Ogre::Quaternion),
417  asOBJ_VALUE | asGetTypeTraits<Ogre::Quaternion>() | asOBJ_POD |
418  asOBJ_APP_CLASS_ALLFLOATS) < 0) {
420  }
421 
422  if(engine->RegisterObjectBehaviour("Quaternion", asBEHAVE_CONSTRUCT,
423  "void f(Real w, Real x, Real y, Real z)", asFUNCTION(QuaternionProxyValues),
424  asCALL_CDECL_OBJFIRST) < 0) {
426  }
427 
428  if(engine->RegisterObjectMethod("Quaternion", "Vector3 xAxis() const",
429  asMETHOD(Ogre::Quaternion, xAxis), asCALL_THISCALL) < 0) {
431  }
432 
433  if(engine->RegisterObjectMethod("Quaternion", "Vector3 yAxis() const",
434  asMETHOD(Ogre::Quaternion, yAxis), asCALL_THISCALL) < 0) {
436  }
437 
438  if(engine->RegisterObjectMethod("Quaternion", "Vector3 zAxis() const",
439  asMETHOD(Ogre::Quaternion, zAxis), asCALL_THISCALL) < 0) {
441  }
442 
443  if(engine->RegisterObjectMethod("Quaternion", "Quaternion Inverse() const",
444  asMETHOD(Ogre::Quaternion, Inverse), asCALL_THISCALL) < 0) {
446  }
447 
448  if(engine->RegisterObjectMethod("Quaternion", "Vector3 opMul(const Vector3 &in vec) const",
449  asMETHODPR(Ogre::Quaternion, operator*,(const Ogre::Vector3&) const, Ogre::Vector3),
450  asCALL_THISCALL) < 0) {
452  }
453 
454  if(engine->RegisterObjectMethod("Quaternion",
455  "Quaternion opMul(const Quaternion &in vec) const",
456  asMETHODPR(
457  Ogre::Quaternion, operator*,(const Ogre::Quaternion&) const, Ogre::Quaternion),
458  asCALL_THISCALL) < 0) {
460  }
461 
462  if(engine->RegisterObjectMethod("Quaternion",
463  "Quaternion& opAssign(const Quaternion &in quat)",
464  asMETHODPR(
465  Ogre::Quaternion, operator=,(const Ogre::Quaternion&), Ogre::Quaternion&),
466  asCALL_THISCALL) < 0) {
468  }
469 
470  // Alias to the above function
471  if(engine->RegisterObjectMethod("Quaternion",
472  "Vector3 RotateVector(const Vector3 &in vec) const",
473  asMETHODPR(Ogre::Quaternion, operator*,(const Ogre::Vector3&) const, Ogre::Vector3),
474  asCALL_THISCALL) < 0) {
476  }
477 
478  if(engine->RegisterObjectProperty("Quaternion", "Real x", asOFFSET(Ogre::Quaternion, x)) <
479  0) {
480 
482  }
483 
484  if(engine->RegisterObjectProperty("Quaternion", "Real y", asOFFSET(Ogre::Quaternion, y)) <
485  0) {
486 
488  }
489 
490  if(engine->RegisterObjectProperty("Quaternion", "Real z", asOFFSET(Ogre::Quaternion, z)) <
491  0) {
492 
494  }
495 
496  if(engine->RegisterObjectProperty("Quaternion", "Real w", asOFFSET(Ogre::Quaternion, w)) <
497  0) {
498 
500  }
501 
502 
503  if(engine->SetDefaultNamespace("Ogre::Quaternion") < 0) {
505  }
506 
507  if(engine->RegisterGlobalProperty("const Ogre::Quaternion IDENTITY",
508  const_cast<Ogre::Quaternion*>(&Ogre::Quaternion::IDENTITY)) < 0) {
510  }
511 
512  if(engine->SetDefaultNamespace("Ogre") < 0) {
514  }
515 
516  // ------------------------------------ //
517 
518  if(engine->RegisterObjectBehaviour("Radian", asBEHAVE_CONSTRUCT, "void f(float radians)",
519  asFUNCTION(RadianProxy), asCALL_CDECL_OBJFIRST) < 0) {
521  }
522 
523  if(engine->RegisterObjectBehaviour("Radian", asBEHAVE_CONSTRUCT,
524  "void f(const Degree &in degree)", asFUNCTION(RadianProxyDegree),
525  asCALL_CDECL_OBJFIRST) < 0) {
527  }
528 
529  if(engine->RegisterObjectBehaviour("Degree", asBEHAVE_CONSTRUCT, "void f(float degrees)",
530  asFUNCTION(DegreeProxy), asCALL_CDECL_OBJFIRST) < 0) {
532  }
533 
534  if(engine->RegisterObjectBehaviour("Degree", asBEHAVE_CONSTRUCT,
535  "void f(const Radian &in radian)", asFUNCTION(DegreeProxyRadian),
536  asCALL_CDECL_OBJFIRST) < 0) {
538  }
539 
540  if(engine->RegisterObjectMethod("Radian", "Degree opImplConv() const",
541  asFUNCTION(RadianToDegreeCast), asCALL_CDECL_OBJFIRST) < 0) {
543  }
544 
545  if(engine->RegisterObjectMethod("Radian", "Real valueDegrees() const",
546  asMETHOD(Ogre::Radian, valueDegrees), asCALL_THISCALL) < 0) {
548  }
549 
550  if(engine->RegisterObjectMethod("Radian", "Real valueRadians() const",
551  asMETHOD(Ogre::Radian, valueRadians), asCALL_THISCALL) < 0) {
553  }
554 
555  if(engine->RegisterObjectMethod("Radian", "Real valueAngleUnits() const",
556  asMETHOD(Ogre::Radian, valueAngleUnits), asCALL_THISCALL) < 0) {
558  }
559 
560  if(engine->RegisterObjectMethod("Degree", "Radian opImplConv() const",
561  asFUNCTION(DegreeToRadianCast), asCALL_CDECL_OBJFIRST) < 0) {
563  }
564 
565  if(engine->RegisterObjectMethod("Degree", "Real valueDegrees() const",
566  asMETHOD(Ogre::Degree, valueDegrees), asCALL_THISCALL) < 0) {
568  }
569 
570  if(engine->RegisterObjectMethod("Degree", "Real valueRadians() const",
571  asMETHOD(Ogre::Degree, valueRadians), asCALL_THISCALL) < 0) {
573  }
574 
575  if(engine->RegisterObjectMethod("Degree", "Real valueAngleUnits() const",
576  asMETHOD(Ogre::Degree, valueAngleUnits), asCALL_THISCALL) < 0) {
578  }
579 
580  if(engine->RegisterObjectBehaviour("Quaternion", asBEHAVE_CONSTRUCT,
581  "void f(const Radian &in radian, const Vector3 &in vector)",
582  asFUNCTION(QuaternionProxyAroundAxis), asCALL_CDECL_OBJFIRST) < 0) {
584  }
585 
586  return true;
587 }
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:80
void DegreeProxy(void *memory, Ogre::Real degree)
Definition: OgreBind.cpp:44
Ogre::Radian DegreeToRadianCast(Ogre::Degree *self)
Definition: OgreBind.cpp:54
void QuaternionProxyValues(void *memory, Ogre::Real W, Ogre::Real X, Ogre::Real Y, Ogre::Real Z)
Definition: OgreBind.cpp:74
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 680 of file CommonEngineBind.cpp.

681 {
682 
683  if(engine->RegisterEnum("NETWORKED_TYPE") < 0) {
685  }
686 
691 
692  if(engine->RegisterObjectType("LeviathanApplication", 0, asOBJ_REF | asOBJ_NOCOUNT) < 0) {
694  }
695 
696  // Global get function //
697  if(engine->RegisterGlobalFunction("LeviathanApplication& GetLeviathanApplication()",
698  asFUNCTION(LeviathanApplication::Get), asCALL_CDECL) < 0) {
700  }
701 
702  if(engine->RegisterObjectMethod("LeviathanApplication", "void MarkAsClosing()",
703  asMETHOD(LeviathanApplication, MarkAsClosing), asCALL_THISCALL) < 0) {
705  }
706 
707  if(engine->RegisterObjectMethod("LeviathanApplication", "bool Quitting()",
708  asMETHOD(LeviathanApplication, Quitting), asCALL_THISCALL) < 0) {
710  }
711 
712  if(engine->RegisterObjectMethod("LeviathanApplication",
713  "NETWORKED_TYPE GetProgramNetType() const",
714  asMETHOD(LeviathanApplication, GetProgramNetType), asCALL_THISCALL) < 0) {
716  }
717 
718  return true;
719 }
#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 1024 of file CommonEngineBind.cpp.

1025 {
1027 
1028  if(engine->RegisterObjectMethod("AudioSource", "bool Play2D()",
1029  asMETHOD(AudioSource, Play2D), asCALL_THISCALL) < 0) {
1031  }
1032 
1033  if(engine->RegisterObjectMethod(
1034  "AudioSource", "void Stop()", asMETHOD(AudioSource, Play2D), asCALL_THISCALL) < 0) {
1036  }
1037 
1038  if(engine->RegisterObjectMethod("AudioSource", "bool IsPlaying() const",
1039  asMETHOD(AudioSource, IsPlaying), asCALL_THISCALL) < 0) {
1041  }
1042 
1043  if(engine->RegisterObjectMethod("AudioSource", "void SetVolume(float volume)",
1044  asMETHOD(AudioSource, SetVolume), asCALL_THISCALL) < 0) {
1046  }
1047 
1048  if(engine->RegisterObjectMethod("AudioSource", "cAudio::IAudioSource& Get()",
1049  asMETHOD(AudioSource, Get), asCALL_THISCALL) < 0) {
1051  }
1052 
1053  if(engine->RegisterObjectMethod("AudioSource", "bool HasInternalSource() const",
1054  asMETHOD(AudioSource, HasInternalSource), asCALL_THISCALL) < 0) {
1056  }
1057 
1058  return true;
1059 }
#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

◆ BindBody()

bool Leviathan::BindBody ( asIScriptEngine *  engine)

Definition at line 40 of file PhysicsBind.cpp.

41 {
43 
44  if(engine->RegisterObjectMethod("PhysicsBody", "Float3 GetVelocity() const",
45  asMETHODPR(PhysicsBody, GetVelocity, () const, Float3), asCALL_THISCALL) < 0) {
47  }
48 
49  if(engine->RegisterObjectMethod("PhysicsBody",
50  "void SetVelocity(const Float3 &in velocity) const",
51  asMETHOD(PhysicsBody, SetVelocity), asCALL_THISCALL) < 0) {
53  }
54 
55  if(engine->RegisterObjectMethod("PhysicsBody", "Float3 GetAngularVelocity() const",
56  asMETHODPR(PhysicsBody, GetAngularVelocity, () const, Float3),
57  asCALL_THISCALL) < 0) {
59  }
60 
61  if(engine->RegisterObjectMethod("PhysicsBody",
62  "void SetAngularVelocity(const Float3 &in omega) const",
63  asMETHOD(PhysicsBody, SetAngularVelocity), asCALL_THISCALL) < 0) {
65  }
66 
67  if(engine->RegisterObjectMethod("PhysicsBody", "void ClearVelocity() const",
68  asMETHOD(PhysicsBody, ClearVelocity), asCALL_THISCALL) < 0) {
70  }
71 
72  if(engine->RegisterObjectMethod("PhysicsBody", "Float3 GetTorque() const",
73  asMETHODPR(PhysicsBody, GetTorque, () const, Float3), asCALL_THISCALL) < 0) {
75  }
76 
77  if(engine->RegisterObjectMethod("PhysicsBody", "void ApplyTorque(const Float3 &in torque)",
78  asMETHOD(PhysicsBody, ApplyTorque), asCALL_THISCALL) < 0) {
80  }
81 
82  if(engine->RegisterObjectMethod("PhysicsBody", "void SetMass(float mass)",
83  asMETHOD(PhysicsBody, SetMass), asCALL_THISCALL) < 0) {
85  }
86 
87  if(engine->RegisterObjectMethod("PhysicsBody", "float get_Mass() const",
88  asMETHOD(PhysicsBody, GetMass), asCALL_THISCALL) < 0) {
90  }
91 
92  if(engine->RegisterObjectMethod("PhysicsBody", "PhysicsShape@ get_Shape() const",
93  asMETHOD(PhysicsBody, GetShapeWrapper), asCALL_THISCALL) < 0) {
95  }
96 
97  if(engine->RegisterObjectMethod("PhysicsBody", "PhysicsShape@ GetShape() const",
98  asMETHOD(PhysicsBody, GetShapeWrapper), asCALL_THISCALL) < 0) {
100  }
101 
102  if(engine->RegisterObjectMethod("PhysicsBody",
103  "bool SetPosition(const Float3 &in pos, const Float4 &in orientation)",
104  asMETHOD(PhysicsBody, SetPosition), asCALL_THISCALL) < 0) {
106  }
107 
108  if(engine->RegisterObjectMethod("PhysicsBody", "Float3 GetPosition() const",
109  asMETHOD(PhysicsBody, GetPosition), asCALL_THISCALL) < 0) {
111  }
112 
113  if(engine->RegisterObjectMethod("PhysicsBody",
114  "bool SetOnlyOrientation(const Float4 &in orientation)",
115  asMETHOD(PhysicsBody, SetOnlyOrientation), asCALL_THISCALL) < 0) {
117  }
118 
119  if(engine->RegisterObjectMethod("PhysicsBody",
120  "void GiveImpulse(const Float3 &in deltaspeed, const Float3 &in point = Float3(0))",
121  asMETHOD(PhysicsBody, GiveImpulse), asCALL_THISCALL) < 0) {
123  }
124 
125  if(engine->RegisterObjectMethod("PhysicsBody",
126  "void SetDamping(float linear, float angular)", asMETHOD(PhysicsBody, SetDamping),
127  asCALL_THISCALL) < 0) {
129  }
130 
131  if(engine->RegisterObjectMethod("PhysicsBody", "void SetFriction(float friction)",
132  asMETHOD(PhysicsBody, SetFriction), asCALL_THISCALL) < 0) {
134  }
135 
136  if(engine->RegisterObjectMethod("PhysicsBody",
137  "void ConstraintMovementAxises(const Float3 &in movement = Float3(1, 0, 1), const "
138  "Float3 &in rotation = Float3(0, 1, 0))",
139  asMETHOD(PhysicsBody, ConstraintMovementAxises), asCALL_THISCALL) < 0) {
141  }
142 
143  return true;
144 }
#define ANGELSCRIPT_REGISTER_REF_TYPE(RegisterName, ClassName)
Definition: BindHelpers.h:90
This is an instance of a collision body.
Definition: PhysicsBody.h:74
#define ANGELSCRIPT_REGISTERFAIL
Definition: BindHelpers.h:10

◆ BindcAudio()

bool Leviathan::BindcAudio ( asIScriptEngine *  engine)

Definition at line 760 of file CommonEngineBind.cpp.

761 {
762  if(engine->SetDefaultNamespace("cAudio") < 0) {
764  }
765 
766  if(engine->RegisterObjectType("IAudioSource", 0, asOBJ_REF | asOBJ_NOHANDLE) < 0) {
768  }
769 
770 
771  if(engine->RegisterObjectMethod("IAudioSource", "bool play()",
772  asMETHOD(cAudio::IAudioSource, play), asCALL_THISCALL) < 0) {
774  }
775 
776  if(engine->RegisterObjectMethod("IAudioSource", "bool play2d(const bool &in toLoop)",
777  asMETHOD(cAudio::IAudioSource, play2d), asCALL_THISCALL) < 0) {
779  }
780 
781  // bool play3d(const cVector3& position, const float& soundstr = 1.0, const bool& toLoop =
782  // false) = 0;
783 
784  if(engine->RegisterObjectMethod("IAudioSource", "bool pause()",
785  asMETHOD(cAudio::IAudioSource, pause), asCALL_THISCALL) < 0) {
787  }
788 
789  if(engine->RegisterObjectMethod("IAudioSource", "void stop()",
790  asMETHOD(cAudio::IAudioSource, stop), asCALL_THISCALL) < 0) {
792  }
793 
794  if(engine->RegisterObjectMethod("IAudioSource", "void loop(const bool &in toLoop)",
795  asMETHOD(cAudio::IAudioSource, loop), asCALL_THISCALL) < 0) {
797  }
798 
799  if(engine->RegisterObjectMethod("IAudioSource",
800  "bool seek(const float &in seconds, bool relative = false)",
801  asMETHOD(cAudio::IAudioSource, seek), asCALL_THISCALL) < 0) {
803  }
804 
805  if(engine->RegisterObjectMethod("IAudioSource", "float getTotalAudioTime()",
806  asMETHOD(cAudio::IAudioSource, getTotalAudioTime), asCALL_THISCALL) < 0) {
808  }
809 
810  if(engine->RegisterObjectMethod("IAudioSource", "int getTotalAudioSize()",
811  asMETHOD(cAudio::IAudioSource, getTotalAudioSize), asCALL_THISCALL) < 0) {
813  }
814 
815  if(engine->RegisterObjectMethod("IAudioSource", "int getCompressedAudioSize()",
816  asMETHOD(cAudio::IAudioSource, getCompressedAudioSize), asCALL_THISCALL) < 0) {
818  }
819 
820  if(engine->RegisterObjectMethod("IAudioSource", "float getCurrentAudioTime()",
821  asMETHOD(cAudio::IAudioSource, getCurrentAudioTime), asCALL_THISCALL) < 0) {
823  }
824 
825  if(engine->RegisterObjectMethod("IAudioSource", "int getCurrentAudioPosition()",
826  asMETHOD(cAudio::IAudioSource, getCurrentAudioPosition), asCALL_THISCALL) < 0) {
828  }
829 
830  if(engine->RegisterObjectMethod("IAudioSource", "int getCurrentCompressedAudioPosition()",
831  asMETHOD(cAudio::IAudioSource, getCurrentCompressedAudioPosition),
832  asCALL_THISCALL) < 0) {
834  }
835 
836  if(engine->RegisterObjectMethod("IAudioSource", "bool isValid() const",
837  asMETHOD(cAudio::IAudioSource, isValid), asCALL_THISCALL) < 0) {
839  }
840 
841  if(engine->RegisterObjectMethod("IAudioSource", "bool isPlaying() const",
842  asMETHOD(cAudio::IAudioSource, isPlaying), asCALL_THISCALL) < 0) {
844  }
845 
846  if(engine->RegisterObjectMethod("IAudioSource", "bool isPaused() const",
847  asMETHOD(cAudio::IAudioSource, isPaused), asCALL_THISCALL) < 0) {
849  }
850 
851  if(engine->RegisterObjectMethod("IAudioSource", "bool isStopped() const",
852  asMETHOD(cAudio::IAudioSource, isStopped), asCALL_THISCALL) < 0) {
854  }
855 
856  if(engine->RegisterObjectMethod("IAudioSource", "bool isLooping() const",
857  asMETHOD(cAudio::IAudioSource, isLooping), asCALL_THISCALL) < 0) {
859  }
860 
861  // void setPosition(const cVector3& position) = 0;
862 
863  // void setVelocity(const cVector3& velocity) = 0;
864 
865  // void setDirection(const cVector3& direction) = 0;
866 
867  if(engine->RegisterObjectMethod("IAudioSource",
868  "void setRolloffFactor(const float &in rolloff)",
869  asMETHOD(cAudio::IAudioSource, setRolloffFactor), asCALL_THISCALL) < 0) {
871  }
872 
873  if(engine->RegisterObjectMethod("IAudioSource",
874  "void setStrength(const float &in soundstrength)",
875  asMETHOD(cAudio::IAudioSource, setStrength), asCALL_THISCALL) < 0) {
877  }
878 
879  if(engine->RegisterObjectMethod("IAudioSource",
880  "void setMinDistance(const float &in minDistance)",
881  asMETHOD(cAudio::IAudioSource, setMinDistance), asCALL_THISCALL) < 0) {
883  }
884 
885  if(engine->RegisterObjectMethod("IAudioSource",
886  "void setMaxAttenuationDistance(const float &in maxDistance)",
887  asMETHOD(cAudio::IAudioSource, setMaxAttenuationDistance), asCALL_THISCALL) < 0) {
889  }
890 
891  if(engine->RegisterObjectMethod("IAudioSource", "void setPitch(const float &in pitch)",
892  asMETHOD(cAudio::IAudioSource, setPitch), asCALL_THISCALL) < 0) {
894  }
895 
896  if(engine->RegisterObjectMethod("IAudioSource", "void setVolume(const float &in volume)",
897  asMETHOD(cAudio::IAudioSource, setVolume), asCALL_THISCALL) < 0) {
899  }
900 
901  if(engine->RegisterObjectMethod("IAudioSource",
902  "void setMinVolume(const float &in minVolume)",
903  asMETHOD(cAudio::IAudioSource, setMinVolume), asCALL_THISCALL) < 0) {
905  }
906 
907  if(engine->RegisterObjectMethod("IAudioSource",
908  "void setMaxVolume(const float &in maxVolume)",
909  asMETHOD(cAudio::IAudioSource, setMaxVolume), asCALL_THISCALL) < 0) {
911  }
912 
913  if(engine->RegisterObjectMethod("IAudioSource",
914  "void setInnerConeAngle(const float &in innerAngle)",
915  asMETHOD(cAudio::IAudioSource, setInnerConeAngle), asCALL_THISCALL) < 0) {
917  }
918 
919  if(engine->RegisterObjectMethod("IAudioSource",
920  "void setOuterConeAngle(const float &in outerAngle)",
921  asMETHOD(cAudio::IAudioSource, setOuterConeAngle), asCALL_THISCALL) < 0) {
923  }
924 
925  if(engine->RegisterObjectMethod("IAudioSource",
926  "void setOuterConeVolume(const float &in outerVolume)",
927  asMETHOD(cAudio::IAudioSource, setOuterConeVolume), asCALL_THISCALL) < 0) {
929  }
930 
931  if(engine->RegisterObjectMethod("IAudioSource",
932  "void setDopplerStrength(const float &in dstrength)",
933  asMETHOD(cAudio::IAudioSource, setDopplerStrength), asCALL_THISCALL) < 0) {
935  }
936 
937 
938  // void setDopplerVelocity(const cVector3& dvelocity) = 0;
939 
940  // void move(const cVector3& position) = 0;
941  // cVector3 getPosition() const = 0;
942  // cVector3 getVelocity() const = 0;
943  // cVector3 getDirection() const = 0;
944 
945  if(engine->RegisterObjectMethod("IAudioSource", "bool isRelative() const",
946  asMETHOD(cAudio::IAudioSource, isRelative), asCALL_THISCALL) < 0) {
948  }
949 
950  if(engine->RegisterObjectMethod("IAudioSource", "float getRolloffFactor() const",
951  asMETHOD(cAudio::IAudioSource, getRolloffFactor), asCALL_THISCALL) < 0) {
953  }
954 
955  if(engine->RegisterObjectMethod("IAudioSource", "float getStrength() const",
956  asMETHOD(cAudio::IAudioSource, getStrength), asCALL_THISCALL) < 0) {
958  }
959 
960  if(engine->RegisterObjectMethod("IAudioSource", "float getMinDistance() const",
961  asMETHOD(cAudio::IAudioSource, getMinDistance), asCALL_THISCALL) < 0) {
963  }
964 
965  if(engine->RegisterObjectMethod("IAudioSource", "float getMaxDistance() const",
966  asMETHOD(cAudio::IAudioSource, getMaxDistance), asCALL_THISCALL) < 0) {
968  }
969 
970  if(engine->RegisterObjectMethod("IAudioSource", "float calculateGain() const",
971  asMETHOD(cAudio::IAudioSource, calculateGain), asCALL_THISCALL) < 0) {
973  }
974 
975  if(engine->RegisterObjectMethod("IAudioSource", "float getPitch() const",
976  asMETHOD(cAudio::IAudioSource, getPitch), asCALL_THISCALL) < 0) {
978  }
979 
980  if(engine->RegisterObjectMethod("IAudioSource", "float getVolume() const",
981  asMETHOD(cAudio::IAudioSource, getVolume), asCALL_THISCALL) < 0) {
983  }
984 
985  if(engine->RegisterObjectMethod("IAudioSource", "float getMinVolume() const",
986  asMETHOD(cAudio::IAudioSource, getMinVolume), asCALL_THISCALL) < 0) {
988  }
989 
990  if(engine->RegisterObjectMethod("IAudioSource", "float getMaxVolume() const",
991  asMETHOD(cAudio::IAudioSource, getMaxVolume), asCALL_THISCALL) < 0) {
993  }
994 
995  if(engine->RegisterObjectMethod("IAudioSource", "float getInnerConeAngle() const",
996  asMETHOD(cAudio::IAudioSource, getInnerConeAngle), asCALL_THISCALL) < 0) {
998  }
999 
1000  if(engine->RegisterObjectMethod("IAudioSource", "float getOuterConeAngle() const",
1001  asMETHOD(cAudio::IAudioSource, getOuterConeAngle), asCALL_THISCALL) < 0) {
1003  }
1004 
1005  if(engine->RegisterObjectMethod("IAudioSource", "float getOuterConeVolume() const",
1006  asMETHOD(cAudio::IAudioSource, getOuterConeVolume), asCALL_THISCALL) < 0) {
1008  }
1009 
1010  if(engine->RegisterObjectMethod("IAudioSource", "float getDopplerStrength() const",
1011  asMETHOD(cAudio::IAudioSource, getDopplerStrength), asCALL_THISCALL) < 0) {
1013  }
1014 
1015  // cVector3 getDopplerVelocity() const = 0;
1016 
1017  if(engine->SetDefaultNamespace("") < 0) {
1019  }
1020 
1021  return true;
1022 }
#define ANGELSCRIPT_REGISTERFAIL
Definition: BindHelpers.h:10

◆ BindColour()

bool Leviathan::BindColour ( asIScriptEngine *  engine)

Definition at line 291 of file OgreBind.cpp.

292 {
293 
294  if(engine->RegisterObjectType("ColourValue", sizeof(Ogre::ColourValue),
295  asOBJ_VALUE | asGetTypeTraits<Ogre::ColourValue>() | asOBJ_POD |
296  asOBJ_APP_CLASS_ALLFLOATS) < 0) {
298  }
299 
300  if(engine->RegisterObjectBehaviour("ColourValue", asBEHAVE_CONSTRUCT,
301  "void f(float r, float g, float b, float a = 1.0)", asFUNCTION(ColourValueProxy),
302  asCALL_CDECL_OBJFIRST) < 0) {
304  }
305 
306  if(engine->RegisterObjectBehaviour("ColourValue", asBEHAVE_CONSTRUCT,
307  "void f(const Vector4 &in values)", asFUNCTION(ColourValueVector4Proxy),
308  asCALL_CDECL_OBJFIRST) < 0) {
310  }
311 
312  if(engine->RegisterObjectProperty(
313  "ColourValue", "float r", asOFFSET(Ogre::ColourValue, r)) < 0) {
315  }
316 
317  if(engine->RegisterObjectProperty(
318  "ColourValue", "float g", asOFFSET(Ogre::ColourValue, g)) < 0) {
320  }
321 
322  if(engine->RegisterObjectProperty(
323  "ColourValue", "float b", asOFFSET(Ogre::ColourValue, b)) < 0) {
325  }
326 
327  if(engine->RegisterObjectProperty(
328  "ColourValue", "float a", asOFFSET(Ogre::ColourValue, a)) < 0) {
330  }
331 
332  if(engine->RegisterObjectMethod("ColourValue",
333  "void getHSB(Real &out hue, Real &out saturation, Real &out brightness) const",
334  asMETHOD(Ogre::ColourValue, getHSB), asCALL_THISCALL) < 0) {
336  }
337 
338  if(engine->RegisterObjectMethod("ColourValue",
339  "void setHSB(Real hue, Real saturation, Real brightness)",
340  asMETHOD(Ogre::ColourValue, setHSB), asCALL_THISCALL) < 0) {
342  }
343 
344  return true;
345 }
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 102 of file EntityBind.cpp.

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

◆ BindComponentTypes()

bool Leviathan::BindComponentTypes ( asIScriptEngine *  engine)

Definition at line 120 of file EntityBind.cpp.

121 {
122  // ------------------------------------ //
123  // Position
124  if(engine->RegisterObjectType("Position", 0, asOBJ_REF | asOBJ_NOCOUNT) < 0) {
126  }
127 
128  if(engine->RegisterObjectProperty("Position", "bool Marked", asOFFSET(Position, Marked)) <
129  0) {
131  }
132 
133  if(engine->RegisterObjectProperty(
134  "Position", "Float3 _Position", asOFFSET(Position, Members._Position)) < 0) {
136  }
137 
138  if(engine->RegisterObjectProperty(
139  "Position", "Float4 _Orientation", asOFFSET(Position, Members._Orientation)) < 0) {
141  }
142 
143  if(!BindComponentTypeID(engine, "Position", &PositionTYPEProxy))
144  return false;
145 
146  // ------------------------------------ //
147  // Physics
148  if(engine->RegisterObjectType("Physics", 0, asOBJ_REF | asOBJ_NOCOUNT) < 0) {
150  }
151 
152  // Currently does nothing
153  if(engine->RegisterObjectProperty("Physics", "bool Marked", asOFFSET(Physics, Marked)) <
154  0) {
156  }
157 
158  if(engine->RegisterObjectMethod("Physics", "PhysicsBody@ get_Body() const",
159  asMETHOD(Physics, GetBodyWrapper), asCALL_THISCALL) < 0) {
161  }
162 
163  if(engine->RegisterObjectMethod("Physics",
164  "PhysicsBody@ CreatePhysicsBody(PhysicalWorld@ world, PhysicsShape@ shape, "
165  "float mass, int physicsmaterialid = -1)",
166  asMETHOD(Physics, CreatePhysicsBodyWrapper), asCALL_THISCALL) < 0) {
168  }
169 
170  if(engine->RegisterObjectMethod("Physics",
171  "bool ChangeShape(PhysicalWorld@ world, PhysicsShape@ shape)",
172  asMETHOD(Physics, ChangeShapeWrapper), asCALL_THISCALL) < 0) {
174  }
175 
176  if(engine->RegisterObjectMethod("Physics", "void JumpTo(Position@ positiontosync)",
177  asMETHOD(Physics, JumpTo), asCALL_THISCALL) < 0) {
179  }
180 
181  if(engine->RegisterObjectMethod("Physics", "void Release(PhysicalWorld@ world)",
182  asMETHOD(Physics, Release), asCALL_THISCALL) < 0) {
184  }
185 
186  if(!BindComponentTypeID(engine, "Physics", &PhysicsTYPEProxy))
187  return false;
188 
189  // ------------------------------------ //
190  // RenderNode
191  if(engine->RegisterObjectType("RenderNode", 0, asOBJ_REF | asOBJ_NOCOUNT) < 0) {
193  }
194 
195  if(engine->RegisterObjectProperty(
196  "RenderNode", "bool Marked", asOFFSET(RenderNode, Marked)) < 0) {
198  }
199 
200  if(engine->RegisterObjectProperty(
201  "RenderNode", "Float3 Scale", asOFFSET(RenderNode, Scale)) < 0) {
203  }
204 
205  if(engine->RegisterObjectProperty(
206  "RenderNode", "Ogre::SceneNode@ Node", asOFFSET(RenderNode, Node)) < 0) {
208  }
209 
210  if(engine->RegisterObjectProperty(
211  "RenderNode", "bool Hidden", asOFFSET(RenderNode, Hidden)) < 0) {
213  }
214 
215  if(!BindComponentTypeID(engine, "RenderNode", &RenderNodeTYPEProxy))
216  return false;
217 
218  // ------------------------------------ //
219  // Sendable
220  if(engine->RegisterObjectType("Sendable", 0, asOBJ_REF | asOBJ_NOCOUNT) < 0) {
222  }
223 
224  if(engine->RegisterObjectProperty("Sendable", "bool Marked", asOFFSET(Sendable, Marked)) <
225  0) {
227  }
228 
229  if(!BindComponentTypeID(engine, "Sendable", &SendableTYPEProxy))
230  return false;
231 
232  // ------------------------------------ //
233  // Received
234  if(engine->RegisterObjectType("Received", 0, asOBJ_REF | asOBJ_NOCOUNT) < 0) {
236  }
237 
238  if(engine->RegisterObjectProperty("Received", "bool Marked", asOFFSET(Received, Marked)) <
239  0) {
241  }
242 
243  if(!BindComponentTypeID(engine, "Received", &ReceivedTYPEProxy))
244  return false;
245 
246  // ------------------------------------ //
247  // Model
248  if(engine->RegisterObjectType("Model", 0, asOBJ_REF | asOBJ_NOCOUNT) < 0) {
250  }
251 
252  if(engine->RegisterObjectProperty("Model", "bool Marked", asOFFSET(Model, Marked)) < 0) {
254  }
255 
256  if(!BindComponentTypeID(engine, "Model", &ModelTYPEProxy))
257  return false;
258 
259  if(engine->RegisterObjectProperty(
260  "Model", "Ogre::Item@ GraphicalObject", asOFFSET(Model, GraphicalObject)) < 0) {
262  }
263 
264  // ------------------------------------ //
265  // BoxGeometry
266  if(engine->RegisterObjectType("BoxGeometry", 0, asOBJ_REF | asOBJ_NOCOUNT) < 0) {
268  }
269 
270  if(engine->RegisterObjectProperty(
271  "BoxGeometry", "bool Marked", asOFFSET(BoxGeometry, Marked)) < 0) {
273  }
274 
275  if(!BindComponentTypeID(engine, "BoxGeometry", &BoxGeometryTYPEProxy))
276  return false;
277 
278  // ------------------------------------ //
279  // ManualObject
280  if(engine->RegisterObjectType("ManualObject", 0, asOBJ_REF | asOBJ_NOCOUNT) < 0) {
282  }
283 
284  if(engine->RegisterObjectProperty(
285  "ManualObject", "bool Marked", asOFFSET(ManualObject, Marked)) < 0) {
287  }
288 
289  if(!BindComponentTypeID(engine, "ManualObject", &ManualObjectTYPEProxy))
290  return false;
291 
292  // ------------------------------------ //
293  // Camera
294  if(engine->RegisterObjectType("Camera", 0, asOBJ_REF | asOBJ_NOCOUNT) < 0) {
296  }
297 
298  if(engine->RegisterObjectProperty("Camera", "bool Marked", asOFFSET(Camera, Marked)) < 0) {
300  }
301 
302  if(engine->RegisterObjectProperty("Camera", "uint8 FOVY", asOFFSET(Camera, FOVY)) < 0) {
304  }
305 
306  if(engine->RegisterObjectProperty(
307  "Camera", "bool SoundPerceiver", asOFFSET(Camera, SoundPerceiver)) < 0) {
309  }
310 
311  if(!BindComponentTypeID(engine, "Camera", &CameraTYPEProxy))
312  return false;
313 
314 
315  // ------------------------------------ //
316  // Plane
317  if(engine->RegisterObjectType("Plane", 0, asOBJ_REF | asOBJ_NOCOUNT) < 0) {
319  }
320 
321  if(engine->RegisterObjectProperty("Plane", "bool Marked", asOFFSET(Plane, Marked)) < 0) {
323  }
324 
325  if(!BindComponentTypeID(engine, "Plane", &PlaneTYPEProxy))
326  return false;
327 
328  if(engine->RegisterObjectProperty(
329  "Plane", "Ogre::Item@ GraphicalObject", asOFFSET(Plane, GraphicalObject)) < 0) {
331  }
332 
333  // ------------------------------------ //
334  // Animated
335  if(engine->RegisterObjectType("Animated", 0, asOBJ_REF | asOBJ_NOCOUNT) < 0) {
337  }
338 
339  if(engine->RegisterObjectProperty("Animated", "bool Marked", asOFFSET(Animated, Marked)) <
340  0) {
342  }
343 
344  if(!BindComponentTypeID(engine, "Animated", &AnimatedTYPEProxy))
345  return false;
346 
347  if(engine->RegisterObjectProperty("Animated", "Ogre::Item@ GraphicalObject",
348  asOFFSET(Animated, GraphicalObject)) < 0) {
350  }
351 
352  // ------------------------------------ //
353  // SimpleAnimation
354  if(engine->RegisterObjectType("SimpleAnimation", sizeof(SimpleAnimation),
355  asOBJ_VALUE | asGetTypeTraits<SimpleAnimation>()) < 0) {
357  }
358  if(engine->RegisterObjectBehaviour("SimpleAnimation", asBEHAVE_CONSTRUCT,
359  "void f(const string &in name)", asFUNCTION(SimpleAnimationConstructorProxy),
360  asCALL_CDECL_OBJFIRST) < 0) {
362  }
363  if(engine->RegisterObjectBehaviour("SimpleAnimation", asBEHAVE_DESTRUCT, "void f()",
364  asFUNCTION(SimpleAnimationDestructorProxy), asCALL_CDECL_OBJFIRST) < 0) {
366  }
367 
368  if(engine->RegisterObjectProperty(
369  "SimpleAnimation", "bool Loop", asOFFSET(SimpleAnimation, Loop)) < 0) {
371  }
372 
373  if(engine->RegisterObjectProperty("SimpleAnimation", "float SpeedFactor",
374  asOFFSET(SimpleAnimation, SpeedFactor)) < 0) {
376  }
377 
378  if(engine->RegisterObjectProperty(
379  "SimpleAnimation", "bool Paused", asOFFSET(SimpleAnimation, Paused)) < 0) {
381  }
382 
383  // Animation helpers
384  if(engine->RegisterObjectMethod("Animated",
385  "void AddAnimation(const SimpleAnimation &in animation)",
386  asFUNCTION(AnimatedAddHelper), asCALL_CDECL_OBJFIRST) < 0) {
388  }
389 
390  if(engine->RegisterObjectMethod("Animated", "SimpleAnimation& GetAnimation(uint64 index)",
391  asFUNCTION(AnimatedGetHelper), asCALL_CDECL_OBJFIRST) < 0) {
393  }
394 
395  return true;
396 }
Plane component.
Definition: Components.h:304
Entity is received from a server.
Definition: Components.h:167
static uint16_t SendableTYPEProxy
Definition: EntityBind.cpp:92
static uint16_t PhysicsTYPEProxy
Definition: EntityBind.cpp:89
static uint16_t ReceivedTYPEProxy
Definition: EntityBind.cpp:93
void SimpleAnimationDestructorProxy(void *memory)
Definition: EntityBind.cpp:43
Contains an nimation for Animated component.
Definition: Components.h:249
static uint16_t BoxGeometryTYPEProxy
Definition: EntityBind.cpp:95
void SimpleAnimationConstructorProxy(void *memory, const std::string &name)
Definition: EntityBind.cpp:38
Entity has a box for geometry/model, possibly also physics.
Definition: Components.h:208
Entity has position and direction it is looking at.
Definition: Components.h:38
Entity has an Ogre scene node.
Definition: Components.h:83
void AnimatedAddHelper(Animated *self, const SimpleAnimation &animation)
Definition: EntityBind.cpp:48
Entity has a physical component.
Definition: Components.h:333
SimpleAnimation * AnimatedGetHelper(Animated *self, uint64_t index)
Definition: EntityBind.cpp:54
static uint16_t PlaneTYPEProxy
Definition: EntityBind.cpp:98
Entity has a model.
Definition: Components.h:229
static uint16_t AnimatedTYPEProxy
Definition: EntityBind.cpp:99
Properties that a camera entity has (will also need a Position component)
Definition: Components.h:699
static uint16_t ModelTYPEProxy
Definition: EntityBind.cpp:94
#define ANGELSCRIPT_REGISTERFAIL
Definition: BindHelpers.h:10
bool BindComponentTypeID(asIScriptEngine *engine, const char *name, uint16_t *value)
Helper for BindComponentTypes.
Definition: EntityBind.cpp:102
Entity plays animations on an Ogre::Item.
Definition: Components.h:284
Entity is sendable to clients.
Definition: Components.h:112
static uint16_t ManualObjectTYPEProxy
Definition: EntityBind.cpp:97
static uint16_t PositionTYPEProxy
Definition: EntityBind.cpp:90
static uint16_t RenderNodeTYPEProxy
Definition: EntityBind.cpp:91
static uint16_t CameraTYPEProxy
Definition: EntityBind.cpp:96

◆ BindDataBlock()

bool Leviathan::BindDataBlock ( asIScriptEngine *  engine)

Definition at line 296 of file CommonEngineBind.cpp.

297 {
298 
299  ANGELSCRIPT_REGISTER_REF_TYPE("ScriptSafeVariableBlock", ScriptSafeVariableBlock);
300 
301  // Some factories //
302  if(engine->RegisterObjectBehaviour("ScriptSafeVariableBlock", asBEHAVE_FACTORY,
303  "ScriptSafeVariableBlock@ f(const string &in blockname, const string &in value)",
304  asFUNCTION(ScriptSafeVariableBlockFactoryString), asCALL_CDECL) < 0) {
306  }
307 
308  if(engine->RegisterObjectBehaviour("ScriptSafeVariableBlock", asBEHAVE_FACTORY,
309  "ScriptSafeVariableBlock@ f(const string &in blockname, float value)",
310  asFUNCTION(ScriptSafeVariableBlockFactoryGeneric<float>), asCALL_CDECL) < 0) {
312  }
313 
314  if(engine->RegisterObjectBehaviour("ScriptSafeVariableBlock", asBEHAVE_FACTORY,
315  "ScriptSafeVariableBlock@ f(const string &in blockname, int value)",
316  asFUNCTION(ScriptSafeVariableBlockFactoryGeneric<int>), asCALL_CDECL) < 0) {
318  }
319 
320  if(engine->RegisterObjectBehaviour("ScriptSafeVariableBlock", asBEHAVE_FACTORY,
321  "ScriptSafeVariableBlock@ f(const string &in blockname, double value)",
322  asFUNCTION(ScriptSafeVariableBlockFactoryGeneric<double>), asCALL_CDECL) < 0) {
324  }
325 
326  if(engine->RegisterObjectBehaviour("ScriptSafeVariableBlock", asBEHAVE_FACTORY,
327  "ScriptSafeVariableBlock@ f(const string &in blockname, int8 value)",
328  asFUNCTION(ScriptSafeVariableBlockFactoryGeneric<char>), asCALL_CDECL) < 0) {
330  }
331 
332  if(engine->RegisterObjectBehaviour("ScriptSafeVariableBlock", asBEHAVE_FACTORY,
333  "ScriptSafeVariableBlock@ f(const string &in blockname, bool value)",
334  asFUNCTION(ScriptSafeVariableBlockFactoryGeneric<bool>), asCALL_CDECL) < 0) {
336  }
337 
338  // Implicit casts for normal types //
339  if(engine->RegisterObjectMethod("ScriptSafeVariableBlock", "string opImplConv() const",
340  WRAP_MFN(ScriptSafeVariableBlock, ConvertAndReturnVariable<std::string>),
341  asCALL_GENERIC) < 0) {
343  }
344 
345  if(engine->RegisterObjectMethod("ScriptSafeVariableBlock", "int opImplConv() const",
346  WRAP_MFN(ScriptSafeVariableBlock, ConvertAndReturnVariable<int>),
347  asCALL_GENERIC) < 0) {
349  }
350 
351  if(engine->RegisterObjectMethod("ScriptSafeVariableBlock", "int8 opImplConv() const",
352  WRAP_MFN(ScriptSafeVariableBlock, ConvertAndReturnVariable<char>),
353  asCALL_GENERIC) < 0) {
355  }
356 
357  if(engine->RegisterObjectMethod("ScriptSafeVariableBlock", "float opImplConv() const",
358  WRAP_MFN(ScriptSafeVariableBlock, ConvertAndReturnVariable<float>),
359  asCALL_GENERIC) < 0) {
361  }
362 
363  if(engine->RegisterObjectMethod("ScriptSafeVariableBlock", "double opImplConv() const",
364  WRAP_MFN(ScriptSafeVariableBlock, ConvertAndReturnVariable<double>),
365  asCALL_GENERIC) < 0) {
367  }
368 
369  if(engine->RegisterObjectMethod("ScriptSafeVariableBlock", "bool opImplConv() const",
370  WRAP_MFN(ScriptSafeVariableBlock, ConvertAndReturnVariable<bool>),
371  asCALL_GENERIC) < 0) {
373  }
374 
375  // type check //
376  if(engine->RegisterObjectMethod("ScriptSafeVariableBlock", "bool IsValidType()",
377  asMETHOD(ScriptSafeVariableBlock, IsValidType), asCALL_THISCALL) < 0) {
379  }
380 
381 
382  return true;
383 }
#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 736 of file CommonEngineBind.cpp.

737 {
738 
739  if(engine->RegisterFuncdef("void DelegateCallbackFunc(NamedVars@ values)") < 0) {
741  }
742 
744 
745  if(engine->RegisterObjectMethod("Delegate", "void Call(NamedVars@ values) const",
746  asMETHODPR(Delegate, Call, (NamedVars*)const, void), asCALL_THISCALL) < 0) {
748  }
749 
750  if(engine->RegisterObjectMethod("Delegate",
751  "void Register(DelegateCallbackFunc@ callback)", asFUNCTION(DelegateRegisterProxy),
752  asCALL_CDECL_OBJFIRST) < 0) {
754  }
755 
756 
757  return true;
758 }
#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 595 of file CommonEngineBind.cpp.

596 {
597  if(engine->RegisterObjectType("Engine", 0, asOBJ_REF | asOBJ_NOHANDLE) < 0) {
599  }
600 
601  // Global get function //
602  if(engine->RegisterGlobalFunction(
603  "Engine& GetEngine()", asFUNCTION(Engine::Get), asCALL_CDECL) < 0) {
605  }
606 
607  // Engine owned singletons //
608  if(!BindRandom(engine))
609  return false;
610 
611  if(engine->RegisterObjectMethod("Engine", "Random& GetRandom()",
612  asMETHOD(Engine, GetRandom), asCALL_THISCALL) < 0) {
614  }
615 
616  if(engine->RegisterObjectMethod("Engine", "EventHandler& GetEventHandler()",
617  asMETHOD(Engine, GetEventHandler), asCALL_THISCALL) < 0) {
619  }
620 
621  if(engine->RegisterObjectMethod("Engine", "SoundDevice& GetSoundDevice()",
622  asMETHOD(Engine, GetSoundDevice), asCALL_THISCALL) < 0) {
624  }
625 
626  if(engine->RegisterObjectMethod("Engine", "FileSystem& GetFileSystem()",
627  asMETHOD(Engine, GetFileSystem), asCALL_THISCALL) < 0) {
629  }
630 
631  if(engine->RegisterObjectMethod("Engine", "ThreadingManager& GetThreadingManager()",
632  asMETHOD(Engine, GetThreadingManager), asCALL_THISCALL) < 0) {
634  }
635 
636  if(engine->RegisterObjectMethod("Engine", "Window& GetWindowEntity()",
637  asMETHOD(Engine, GetWindowEntity), asCALL_THISCALL) < 0) {
639  }
640 
641  // ------------------------------------ //
642 
643  if(engine->RegisterObjectMethod("Engine", "int64 GetTimeSinceLastTick()",
644  asMETHOD(Engine, GetTimeSinceLastTick), asCALL_THISCALL) < 0) {
646  }
647 
648  if(engine->RegisterObjectMethod("Engine", "int GetCurrentTick()",
649  asMETHOD(Engine, GetCurrentTick), asCALL_THISCALL) < 0) {
651  }
652 
653  if(engine->RegisterObjectMethod("Engine", "int GetWindowOpenCount()",
654  asMETHOD(Engine, GetWindowOpenCount), asCALL_THISCALL) < 0) {
656  }
657 
658  if(engine->RegisterObjectMethod(
659  "Engine", "void MarkQuit()", asMETHOD(Engine, MarkQuit), asCALL_THISCALL) < 0) {
661  }
662 
663  if(engine->RegisterObjectMethod("Engine", "bool IsOnMainThread()",
664  asMETHOD(Engine, IsOnMainThread), asCALL_THISCALL) < 0) {
666  }
667 
668  if(engine->RegisterFuncdef("void InvokeCallbackFunc()") < 0) {
670  }
671 
672  if(engine->RegisterObjectMethod("Engine", "void Invoke(InvokeCallbackFunc@ callback)",
673  asFUNCTION(InvokeProxy), asCALL_CDECL_OBJFIRST) < 0) {
675  }
676 
677  return true;
678 }
The main class of the Leviathan Game Engine.
Definition: Engine.h:33
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 1143 of file CommonEngineBind.cpp.

1144 {
1145 
1146  if(!BindNamedVars(engine))
1147  return false;
1148 
1149  if(!BindEvents(engine))
1150  return false;
1151 
1152  if(!BindcAudio(engine))
1153  return false;
1154 
1155  if(!BindSound(engine))
1156  return false;
1157 
1158  if(!BindFileSystem(engine))
1159  return false;
1160 
1161  if(!BindThreadingManager(engine))
1162  return false;
1163 
1164  if(!BindWindow(engine))
1165  return false;
1166 
1167  if(!BindEngine(engine))
1168  return false;
1169 
1170  if(!BindApplication(engine))
1171  return false;
1172 
1173  if(!BindGameModule(engine))
1174  return false;
1175 
1176  if(!BindDelegates(engine))
1177  return false;
1178 
1179 
1180  // ------------------ Global functions ------------------ //
1181  if(engine->RegisterGlobalFunction("string GetLeviathanVersion()",
1182  asFUNCTION(GetLeviathanVersionProxy), asCALL_CDECL) < 0) {
1184  }
1185 
1186  if(engine->RegisterGlobalFunction("void LOG_WRITE(const string &in message)",
1187  asFUNCTION(LOG_WRITEProxy), asCALL_CDECL) < 0) {
1189  }
1190 
1191  if(engine->RegisterGlobalFunction("void LOG_INFO(const string &in message)",
1192  asFUNCTION(LOG_INFOProxy), asCALL_CDECL) < 0) {
1194  }
1195 
1196  if(engine->RegisterGlobalFunction("void LOG_WARNING(const string &in message)",
1197  asFUNCTION(LOG_WARNINGProxy), asCALL_CDECL) < 0) {
1199  }
1200 
1201  if(engine->RegisterGlobalFunction("void LOG_ERROR(const string &in message)",
1202  asFUNCTION(LOG_ERRORProxy), asCALL_CDECL) < 0) {
1204  }
1205  // LOG_FATAL not bound
1206  // Use assert instead
1207 
1208  if(engine->RegisterGlobalFunction("void Print(const string &in message)",
1209  asFUNCTION(Logger::Print), asCALL_CDECL) < 0) {
1211  }
1212 
1213  if(engine->RegisterGlobalFunction("void assert(bool expression, const string &in message)",
1214  asFUNCTION(AngelScriptAssertWrapper), asCALL_GENERIC) < 0) {
1216  }
1217  if(engine->RegisterGlobalFunction("void assert(bool expression)",
1218  asFUNCTION(AngelScriptAssertWrapper), asCALL_GENERIC) < 0) {
1220  }
1221 
1222  if(engine->RegisterGlobalFunction(
1223  "bool IsInGraphicalMode()", asFUNCTION(IsInGraphicalMode), asCALL_CDECL) < 0) {
1225  }
1226 
1227  if(engine->RegisterGlobalFunction(
1228  "void PrintCallStack()", asFUNCTION(PrintASCallStack), asCALL_CDECL) < 0) {
1230  }
1231 
1232  // ------------------------------------ //
1233  // Global vars
1234  if(engine->RegisterGlobalProperty("const float PI", &PIProxy) < 0) {
1235 
1237  }
1238 
1239  if(engine->RegisterGlobalProperty("const float EPSILON", &EPSILONProxy) < 0) {
1240 
1242  }
1243 
1244  if(engine->RegisterGlobalProperty(
1245  "const float DEGREES_TO_RADIANS", &DEGREES_TO_RADIANSProxy) < 0) {
1246 
1248  }
1249 
1250  if(engine->RegisterGlobalProperty(
1251  "const float RADIANS_TO_DEGREES", &RADIANS_TO_DEGREESProxy) < 0) {
1252 
1254  }
1255 
1256  if(engine->RegisterGlobalProperty("const int TICKSPEED", &TICKSPEEDProxy) < 0) {
1257 
1259  }
1260 
1261  if(engine->RegisterGlobalProperty(
1262  "const uint8 DEFAULT_RENDER_QUEUE", &DEFAULT_RENDER_QUEUEProxy) < 0) {
1263 
1265  }
1266 
1267 
1268  return true;
1269 }
bool BindEngine(asIScriptEngine *engine)
bool BindEvents(asIScriptEngine *engine)
static std::string GetLeviathanVersionProxy()
void PrintASCallStack()
Prints current angelscript callstack.
static uint8_t DEFAULT_RENDER_QUEUEProxy
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)
bool BindWindow(asIScriptEngine *engine)
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
bool IsInGraphicalMode()
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 521 of file EntityBind.cpp.

522 {
523 
524  // TODO: add reference counting for GameWorld
525  if(engine->RegisterObjectType("GameWorld", 0, asOBJ_REF | asOBJ_NOCOUNT) < 0) {
527  }
528 
529  if(!BindScriptComponentTypeSupport(engine))
530  return false;
531 
532  if(!BindRayCast(engine))
533  return false;
534 
535  if(!BindComponentTypes(engine))
536  return false;
537 
538  if(!BindGameWorldBaseMethods<GameWorld>(engine, "GameWorld"))
539  return false;
540 
541  // Component get functions //
542  // GameWorld
543 
544  // ------------------------------------ //
545  if(engine->RegisterObjectType("StandardWorld", 0, asOBJ_REF | asOBJ_NOCOUNT) < 0) {
547  }
548 
549  if(!BindStandardWorldMethods<StandardWorld>(engine, "StandardWorld"))
550  return false;
551 
552  // ------------------------------------ //
553 
554  return true;
555 }
bool BindScriptComponentTypeSupport(asIScriptEngine *engine)
Definition: EntityBind.cpp:398
bool BindRayCast(asIScriptEngine *engine)
Definition: EntityBind.cpp:68
bool BindComponentTypes(asIScriptEngine *engine)
Definition: EntityBind.cpp:120
#define ANGELSCRIPT_REGISTERFAIL
Definition: BindHelpers.h:10

◆ BindEvents()

bool Leviathan::BindEvents ( asIScriptEngine *  engine)

Definition at line 385 of file CommonEngineBind.cpp.

386 {
387 
388  // bind event type enum //
389  if(engine->RegisterEnum("EVENT_TYPE") < 0) {
391  }
392 
397 
398  // bind event //
400 
401  if(engine->RegisterObjectBehaviour("Event", asBEHAVE_FACTORY, "Event@ f(EVENT_TYPE type)",
402  asFUNCTION(WrapperEventFactory), asCALL_CDECL) < 0) {
404  }
405 
406  // bind generic event //
408 
409  // Factory //
410  if(engine->RegisterObjectBehaviour("GenericEvent", asBEHAVE_FACTORY,
411  "GenericEvent@ f(const string &in typename)",
412  asFUNCTION(WrapperGenericEventFactory), asCALL_CDECL) < 0) {
414  }
415 
416  // Data get function //
417  if(engine->RegisterObjectMethod("GenericEvent", "NamedVars@ GetNamedVars()",
418  asMETHOD(GenericEvent, GetNamedVarsRefCounted), asCALL_THISCALL) < 0) {
420  }
421 
422  if(engine->RegisterObjectMethod("GenericEvent", "string GetType() const",
423  asMETHOD(GenericEvent, GetType), asCALL_THISCALL) < 0) {
425  }
426 
427  // Event handler which cannot be instantiated or copied around //
428  if(engine->RegisterObjectType("EventHandler", 0, asOBJ_REF | asOBJ_NOHANDLE) < 0) {
430  }
431 
432  // Script event firing //
433  if(engine->RegisterObjectMethod("EventHandler", "void CallEvent(GenericEvent@ event)",
434  asMETHODPR(EventHandler, CallEvent, (GenericEvent*), void), asCALL_THISCALL) < 0) {
436  }
437 
438  // Event listener //
440 
441  if(engine->RegisterFuncdef("int OnEventCallback(Event@ event)") < 0) {
443  }
444 
445  if(engine->RegisterFuncdef("int OnGenericEventCallback(GenericEvent@ event)") < 0) {
447  }
448 
449  if(engine->RegisterObjectBehaviour("EventListener", asBEHAVE_FACTORY,
450  "EventListener@ f(OnEventCallback@ onevent, OnGenericEventCallback@ ongeneric)",
451  asFUNCTION(Script::EventListenerFactory), asCALL_CDECL) < 0) {
453  }
454 
455  if(engine->RegisterObjectMethod("EventListener", "bool RegisterForEvent(EVENT_TYPE type)",
456  asMETHOD(Script::EventListener, RegisterForEventType), asCALL_THISCALL) < 0) {
458  }
459 
460  if(engine->RegisterObjectMethod("EventListener",
461  "bool RegisterForEvent(const string &in name)",
462  asMETHOD(Script::EventListener, RegisterForEventGeneric), asCALL_THISCALL) < 0) {
464  }
465 
466 
467  return true;
468 }
Class that represents a statically defined event.
Definition: Event.h:109
Allows object to register for events that can be fired from anywhere.
Definition: EventHandler.h:15
#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:141
EventListener * EventListenerFactory(asIScriptFunction *onevent, asIScriptFunction *ongeneric)
Event * WrapperEventFactory(EVENT_TYPE type)
GenericEvent * WrapperGenericEventFactory(const std::string &name)
#define ANGELSCRIPT_REGISTERFAIL
Definition: BindHelpers.h:10
An EventListener that scripts can use to listen for events.

◆ BindFileSystem()

bool Leviathan::BindFileSystem ( asIScriptEngine *  engine)

Definition at line 1086 of file CommonEngineBind.cpp.

1087 {
1088  // Many of the filesystem methods aren't safe to expose to every
1089  // script so they are hidden by default
1090  if(engine->RegisterEnum("FILEGROUP") < 0) {
1092  }
1093 
1099 
1100  if(engine->RegisterObjectType("FileSystem", 0, asOBJ_REF | asOBJ_NOHANDLE) < 0) {
1102  }
1103 
1104  const auto oldMask =
1105  engine->SetDefaultAccessMask(static_cast<AccessFlags>(ScriptAccess::FullFileSystem));
1106 
1107  if(engine->RegisterObjectMethod("FileSystem",
1108  "string SearchForFile(FILEGROUP which, const string &in name, const string &in "
1109  "extensions, bool searchall = true)",
1110  asMETHOD(FileSystem, SearchForFile), asCALL_THISCALL) < 0) {
1112  }
1113 
1114  // Restore access for non-full access requiring static stuff
1115  engine->SetDefaultAccessMask(oldMask);
1116 
1117  // ------------------------------------ //
1118  // Static methods
1119  if(engine->SetDefaultNamespace("FileSystem") < 0) {
1121  }
1122 
1123  // And back to protected functions
1124  engine->SetDefaultAccessMask(static_cast<AccessFlags>(ScriptAccess::FullFileSystem));
1125 
1126  if(engine->RegisterGlobalFunction("bool FileExists(const string &in filepath)",
1127  asFUNCTION(FileSystem::FileExists), asCALL_CDECL) < 0) {
1128 
1130  }
1131 
1132  // Restore settings //
1133  engine->SetDefaultAccessMask(oldMask);
1134  if(engine->SetDefaultNamespace("") < 0) {
1136  }
1137 
1138  return true;
1139 }
Class for indexing and searching game data directory.
Definition: FileSystem.h:65
#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 210 of file TypesBind.cpp.

211 {
212 
213  if(engine->RegisterObjectType("Float2", sizeof(Float2),
214  asOBJ_VALUE | asGetTypeTraits<Float2>() | asOBJ_APP_CLASS_ALLFLOATS) < 0) {
216  }
217  if(engine->RegisterObjectBehaviour("Float2", asBEHAVE_CONSTRUCT, "void f()",
218  asFUNCTION(Float2ConstructorProxy), asCALL_CDECL_OBJFIRST) < 0) {
220  }
221  if(engine->RegisterObjectBehaviour("Float2", asBEHAVE_CONSTRUCT, "void f(float value)",
222  asFUNCTION(Float2ConstructorProxySingle), asCALL_CDECL_OBJFIRST) < 0) {
224  }
225  if(engine->RegisterObjectBehaviour("Float2", asBEHAVE_CONSTRUCT,
226  "void f(float x, float y)", asFUNCTION(Float2ConstructorProxyAll),
227  asCALL_CDECL_OBJFIRST) < 0) {
229  }
230  if(engine->RegisterObjectBehaviour("Float2", asBEHAVE_CONSTRUCT,
231  "void f(const Float2 &in other)", asFUNCTION(Float2ConstructorProxyCopy),
232  asCALL_CDECL_OBJFIRST) < 0) {
234  }
235  if(engine->RegisterObjectBehaviour("Float2", asBEHAVE_DESTRUCT, "void f()",
236  asFUNCTION(Float2DestructorProxy), asCALL_CDECL_OBJFIRST) < 0) {
238  }
239  // Operators //
240  if(engine->RegisterObjectMethod("Float2", "Float2& opAssign(const Float2 &in other)",
241  asMETHODPR(Float2, operator=,(const Float2&), Float2&), asCALL_THISCALL) < 0) {
243  }
244 
245  if(engine->RegisterObjectMethod("Float2", "Float2 opAdd(const Float2 &in other) const",
246  asMETHODPR(Float2, operator+,(const Float2&) const, Float2), asCALL_THISCALL) < 0) {
248  }
249 
250  if(engine->RegisterObjectMethod("Float2", "Float2 opSub(const Float2 &in other) const",
251  asMETHODPR(Float2, operator-,(const Float2&) const, Float2), asCALL_THISCALL) < 0) {
253  }
254 
255  if(engine->RegisterObjectMethod("Float2", "Float2 opMul(float multiply) const",
256  asMETHODPR(Float2, operator*,(float) const, Float2), asCALL_THISCALL) < 0) {
258  }
259 
260  if(engine->RegisterObjectMethod("Float2", "Float2 Normalize() const",
261  asMETHOD(Float2, Normalize), asCALL_THISCALL) < 0) {
263  }
264 
265  if(engine->RegisterObjectMethod(
266  "Float2", "float HAddAbs()", asMETHOD(Float2, HAddAbs), asCALL_THISCALL) < 0) {
268  }
269 
270  if(engine->RegisterObjectMethod("Float2", "bool HasInvalidValues() const",
271  asMETHOD(Float2, HasInvalidValues), asCALL_THISCALL) < 0) {
273  }
274 
275  // Direct access
276  if(engine->RegisterObjectProperty("Float2", "float X", asOFFSET(Float2, X)) < 0) {
277 
279  }
280 
281  if(engine->RegisterObjectProperty("Float2", "float Y", asOFFSET(Float2, Y)) < 0) {
282 
284  }
285 
286  return true;
287 }
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 289 of file TypesBind.cpp.

290 {
291  if(engine->RegisterObjectType("Float3", sizeof(Float3),
292  asOBJ_VALUE | asGetTypeTraits<Float3>() | asOBJ_APP_CLASS_ALLFLOATS) < 0) {
294  }
295  if(engine->RegisterObjectBehaviour("Float3", asBEHAVE_CONSTRUCT, "void f()",
296  asFUNCTION(Float3ConstructorProxy), asCALL_CDECL_OBJFIRST) < 0) {
298  }
299  if(engine->RegisterObjectBehaviour("Float3", asBEHAVE_CONSTRUCT, "void f(float value)",
300  asFUNCTION(Float3ConstructorProxySingle), asCALL_CDECL_OBJFIRST) < 0) {
302  }
303  if(engine->RegisterObjectBehaviour("Float3", asBEHAVE_CONSTRUCT,
304  "void f(float x, float y, float z)", asFUNCTION(Float3ConstructorProxyAll),
305  asCALL_CDECL_OBJFIRST) < 0) {
307  }
308  if(engine->RegisterObjectBehaviour("Float3", asBEHAVE_CONSTRUCT,
309  "void f(const Float3 &in other)", asFUNCTION(Float3ConstructorProxyCopy),
310  asCALL_CDECL_OBJFIRST) < 0) {
312  }
313  if(engine->RegisterObjectBehaviour("Float3", asBEHAVE_CONSTRUCT,
314  "void f(const Int3 &in values)", asFUNCTION(Float3ConstructorProxyFromInt3),
315  asCALL_CDECL_OBJFIRST) < 0) {
317  }
318 
319  if(engine->RegisterObjectBehaviour("Float3", asBEHAVE_DESTRUCT, "void f()",
320  asFUNCTION(Float3DestructorProxy), asCALL_CDECL_OBJFIRST) < 0) {
322  }
323  // Operators //
324  if(engine->RegisterObjectMethod("Float3", "Float3& opAssign(const Float3 &in other)",
325  asMETHODPR(Float3, operator=,(const Float3&), Float3&), asCALL_THISCALL) < 0) {
327  }
328 
329  if(engine->RegisterObjectMethod("Float3", "Float3 opAdd(const Float3 &in other) const",
330  asMETHODPR(Float3, operator+,(const Float3&) const, Float3), asCALL_THISCALL) < 0) {
332  }
333 
334  if(engine->RegisterObjectMethod("Float3", "Float3 opNeg() const",
335  asMETHODPR(Float3, operator-,() const, Float3), asCALL_THISCALL) < 0) {
337  }
338 
339  if(engine->RegisterObjectMethod("Float3", "bool opEquals(const Float3 &in other) const",
340  asMETHODPR(Float3, operator==,(const Float3&) const, bool), asCALL_THISCALL) < 0) {
342  }
343 
344  if(engine->RegisterObjectMethod("Float3", "Float3& opAddAssign(const Float3 &in other)",
345  asMETHODPR(Float3, operator+=,(const Float3&), Float3&), asCALL_THISCALL) < 0) {
347  }
348 
349  if(engine->RegisterObjectMethod("Float3", "Float3& opSubAssign(const Float3 &in other)",
350  asMETHODPR(Float3, operator-=,(const Float3&), Float3&), asCALL_THISCALL) < 0) {
352  }
353 
354  if(engine->RegisterObjectMethod("Float3", "Float3 opSub(const Float3 &in other) const",
355  asMETHODPR(Float3, operator-,(const Float3&) const, Float3), asCALL_THISCALL) < 0) {
357  }
358 
359  if(engine->RegisterObjectMethod("Float3", "Float3 opMul(float multiply) const",
360  asMETHODPR(Float3, operator*,(float) const, Float3), asCALL_THISCALL) < 0) {
362  }
363 
364  if(engine->RegisterObjectMethod("Float3", "Float3 opMul(const Float3 &in other) const",
365  asMETHODPR(Float3, operator*,(const Float3&) const, Float3), asCALL_THISCALL) < 0) {
367  }
368 
369  // Return value isn't actually void here
370  if(engine->RegisterObjectMethod("Float3", "void opDivAssign(const float &in value)",
371  asMETHODPR(Float3, operator/=,(const float&), Float3&), asCALL_THISCALL) < 0) {
373  }
374 
375 
376  if(engine->RegisterObjectMethod("Float3", "Float3 Normalize() const",
377  asMETHOD(Float3, Normalize), asCALL_THISCALL) < 0) {
379  }
380 
381  if(engine->RegisterObjectMethod("Float3", "float HAddAbs() const",
382  asMETHOD(Float3, HAddAbs), asCALL_THISCALL) < 0) {
384  }
385 
386  if(engine->RegisterObjectMethod(
387  "Float3", "float HAdd() const", asMETHOD(Float3, HAdd), asCALL_THISCALL) < 0) {
389  }
390 
391  if(engine->RegisterObjectMethod("Float3", "float LengthSquared() const",
392  asMETHOD(Float3, LengthSquared), asCALL_THISCALL) < 0) {
394  }
395 
396  if(engine->RegisterObjectMethod("Float3", "float Dot(const Float3 &in val) const",
397  asMETHOD(Float3, Dot), asCALL_THISCALL) < 0) {
399  }
400 
401  if(engine->RegisterObjectMethod("Float3", "Float3 Cross(const Float3 &in val) const",
402  asMETHOD(Float3, Cross), asCALL_THISCALL) < 0) {
404  }
405 
406  if(engine->RegisterObjectMethod("Float3", "bool HasInvalidValues() const",
407  asMETHOD(Float3, HasInvalidValues), asCALL_THISCALL) < 0) {
409  }
410 
411  // Direct access
412  if(engine->RegisterObjectProperty("Float3", "float X", asOFFSET(Float3, X)) < 0) {
413 
415  }
416 
417  if(engine->RegisterObjectProperty("Float3", "float Y", asOFFSET(Float3, Y)) < 0) {
418 
420  }
421 
422  if(engine->RegisterObjectProperty("Float3", "float Z", asOFFSET(Float3, Z)) < 0) {
423 
425  }
426 
427 
428  // ------------------------------------ //
429  // Named ones
430  if(engine->SetDefaultNamespace("Float3") < 0) {
432  }
433 
434  if(engine->RegisterGlobalProperty("const Float3 UnitVUp", &UnitVUpProxy) < 0) {
435 
437  }
438 
439  if(engine->SetDefaultNamespace("") < 0) {
441  }
442 
443 
444 
445  return true;
446 }
void Float3ConstructorProxy(void *memory)
Definition: TypesBind.cpp:44
void Float3ConstructorProxyFromInt3(void *memory, const Int3 &values)
Definition: TypesBind.cpp:64
void Float3ConstructorProxyAll(void *memory, float x, float y, float z)
Definition: TypesBind.cpp:49
static auto UnitVUpProxy
Definition: TypesBind.cpp:204
void Float3DestructorProxy(void *memory)
Definition: TypesBind.cpp:69
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 448 of file TypesBind.cpp.

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

◆ BindGameModule()

bool Leviathan::BindGameModule ( asIScriptEngine *  engine)

Definition at line 721 of file CommonEngineBind.cpp.

722 {
723 
725 
726  // Bind simple name get function //
727  if(engine->RegisterObjectMethod("GameModule", "string GetDescription(bool full = false)",
728  asMETHOD(GameModule, GetDescription), asCALL_THISCALL) < 0) {
730  }
731 
732 
733  return true;
734 }
#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:18

◆ 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) {
54  // ANGELSCRIPT_REGISTERFAIL;
55  // }
56 
57  if(engine->RegisterObjectMethod(classname,
58  "Ogre::Ray CastRayFromCamera(float x, float y) const",
59  asMETHOD(WorldType, CastRayFromCamera), asCALL_THISCALL) < 0) {
61  }
62 
63  // ------------------------------------ //
64  // Support for script types
65  if(engine->RegisterObjectMethod(classname,
66  "array<ObjectID>@ GetRemovedIDsForComponents(array<uint16>@ componenttypes)",
67  asMETHOD(WorldType, GetRemovedIDsForComponents), asCALL_THISCALL) < 0) {
69  }
70 
71  if(engine->RegisterObjectMethod(classname,
72  "array<ObjectID>@ GetRemovedIDsForScriptComponents(array<string>@ typenames)",
73  asMETHOD(WorldType, GetRemovedIDsForScriptComponents), asCALL_THISCALL) < 0) {
75  }
76 
77  if(engine->RegisterObjectMethod(classname,
78  "bool RegisterScriptComponentType(const string &in name, ComponentFactoryFunc@ "
79  "factory)",
80  asMETHOD(WorldType, RegisterScriptComponentType), asCALL_THISCALL) < 0) {
82  }
83 
84  if(engine->RegisterObjectMethod(classname,
85  "bool RegisterScriptSystem(const string &in name, ScriptSystem@ systemobject)",
86  asMETHOD(WorldType, RegisterScriptSystem), asCALL_THISCALL) < 0) {
88  }
89 
90  if(engine->RegisterObjectMethod(classname,
91  "bool UnregisterScriptSystem(const string &in name)",
92  asMETHOD(WorldType, UnregisterScriptSystem), asCALL_THISCALL) < 0) {
94  }
95 
96  if(engine->RegisterObjectMethod(classname,
97  "ScriptComponentHolder@ GetScriptComponentHolder(const string &in name)",
98  asMETHOD(WorldType, GetScriptComponentHolder), asCALL_THISCALL) < 0) {
100  }
101 
102  if(engine->RegisterObjectMethod(classname,
103  "ScriptSystem@ GetScriptSystem(const string &in name)",
104  asMETHOD(WorldType, GetScriptSystem), asCALL_THISCALL) < 0) {
106  }
107 
108  // ------------------------------------ //
109  if(engine->RegisterObjectMethod(classname, "Ogre::SceneManager@ GetScene()",
110  asMETHOD(WorldType, GetScene), asCALL_THISCALL) < 0) {
112  }
113 
114  // ------------------------------------ //
115  // Somewhat questionable Ogre shortcuts that should probably be component types
116  if(engine->RegisterObjectMethod(classname, "void SetSunlight()",
117  asMETHOD(WorldType, SetSunlight), asCALL_THISCALL) < 0) {
119  }
120 
121  if(engine->RegisterObjectMethod(classname, "void RemoveSunlight()",
122  asMETHOD(WorldType, RemoveSunlight), asCALL_THISCALL) < 0) {
124  }
125 
126  if(engine->RegisterObjectMethod(classname,
127  "void SetLightProperties(const Ogre::ColourValue &in diffuse, const "
128  "Ogre::ColourValue &in specular, const Ogre::Vector3 &in direction, float power, "
129  "const Ogre::ColourValue &in upperhemisphere, const Ogre::ColourValue &in "
130  "lowerhemisphere, const Ogre::Vector3 &in hemispheredir, float envmapscale = 1.0f)",
131  asMETHOD(WorldType, SetLightProperties), asCALL_THISCALL) < 0) {
133  }
134 
135  // ------------------------------------ //
136  // These are inefficient versions of the get methods, prefer the ones in derived classes
137  if(engine->RegisterObjectMethod(classname,
138  "Physics@ BaseWorldGetComponentPhysics(ObjectID id)",
139  asMETHODPR(WorldType, template GetComponent<Physics>, (ObjectID), Physics&),
140  asCALL_THISCALL) < 0) {
142  }
143 
144  if(engine->RegisterObjectMethod(classname,
145  "Position@ BaseWorldGetComponentPosition(ObjectID id)",
146  asMETHODPR(WorldType, template GetComponent<Position>, (ObjectID), Position&),
147  asCALL_THISCALL) < 0) {
149  }
150 
151  return true;
152 }
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 599 of file TypesBind.cpp.

600 {
601 
602  if(engine->RegisterObjectType("Int2", sizeof(Int2),
603  asOBJ_VALUE | asGetTypeTraits<Int2>() | asOBJ_APP_CLASS_ALLINTS) < 0) {
605  }
606  if(engine->RegisterObjectBehaviour("Int2", asBEHAVE_CONSTRUCT, "void f()",
607  asFUNCTION(Int2ConstructorProxy), asCALL_CDECL_OBJFIRST) < 0) {
609  }
610  if(engine->RegisterObjectBehaviour("Int2", asBEHAVE_CONSTRUCT, "void f(int value)",
611  asFUNCTION(Int2ConstructorProxySingle), asCALL_CDECL_OBJFIRST) < 0) {
613  }
614  if(engine->RegisterObjectBehaviour("Int2", asBEHAVE_CONSTRUCT, "void f(int x, int y)",
615  asFUNCTION(Int2ConstructorProxyAll), asCALL_CDECL_OBJFIRST) < 0) {
617  }
618  if(engine->RegisterObjectBehaviour("Int2", asBEHAVE_CONSTRUCT,
619  "void f(const Int2 &in other)", asFUNCTION(Int2ConstructorProxyCopy),
620  asCALL_CDECL_OBJFIRST) < 0) {
622  }
623  if(engine->RegisterObjectBehaviour("Int2", asBEHAVE_DESTRUCT, "void f()",
624  asFUNCTION(Int2DestructorProxy), asCALL_CDECL_OBJFIRST) < 0) {
626  }
627 
628  if(engine->RegisterObjectBehaviour("Int2", asBEHAVE_LIST_CONSTRUCT,
629  "void f(const int &in) {int, int}", asFUNCTION(Int2ListConstructor),
630  asCALL_CDECL_OBJFIRST) < 0) {
632  }
633 
634  // Operators //
635  if(engine->RegisterObjectMethod("Int2", "Int2& opAssign(const Int2 &in other)",
636  asMETHODPR(Int2, operator=,(const Int2&), Int2&), asCALL_THISCALL) < 0) {
638  }
639 
640  if(engine->RegisterObjectMethod("Int2", "Int2 opAdd(const Int2 &in other) const",
641  asMETHODPR(Int2, operator+,(const Int2&) const, Int2), asCALL_THISCALL) < 0) {
643  }
644 
645  if(engine->RegisterObjectMethod("Int2", "Int2 opSub(const Int2 &in other) const",
646  asMETHODPR(Int2, operator-,(const Int2&) const, Int2), asCALL_THISCALL) < 0) {
648  }
649 
650  if(engine->RegisterObjectMethod("Int2", "Int2 opMul(int multiply) const",
651  asMETHODPR(Int2, operator*,(int) const, Int2), asCALL_THISCALL) < 0) {
653  }
654 
655  // Direct access
656  if(engine->RegisterObjectProperty("Int2", "int X", asOFFSET(Int2, X)) < 0) {
657 
659  }
660 
661  if(engine->RegisterObjectProperty("Int2", "int Y", asOFFSET(Int2, Y)) < 0) {
662 
664  }
665 
666  return true;
667 }
void Int2DestructorProxy(void *memory)
Definition: TypesBind.cpp:126
void Int2ConstructorProxySingle(void *memory, int all)
Definition: TypesBind.cpp:111
void Int2ConstructorProxyAll(void *memory, int x, int y)
Definition: TypesBind.cpp:106
#define ANGELSCRIPT_REGISTERFAIL
Definition: BindHelpers.h:10
void Int2ListConstructor(void *memory, int *list)
Definition: TypesBind.cpp:121
void Int2ConstructorProxy(void *memory)
Definition: TypesBind.cpp:101
void Int2ConstructorProxyCopy(void *memory, const Int2 &other)
Definition: TypesBind.cpp:116

◆ BindInt3()

bool Leviathan::BindInt3 ( asIScriptEngine *  engine)

Definition at line 669 of file TypesBind.cpp.

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

◆ BindMathOperations()

bool Leviathan::BindMathOperations ( asIScriptEngine *  engine)

Definition at line 64 of file BindStandardFunctions.cpp.

65 {
66 
67  // ------------------------------------ //
68  // min
69  if(engine->RegisterGlobalFunction(
70  "const float & min(const float &in a, const float &in b)",
71  asFUNCTIONPR(std::min<float>, (const float&, const float&), const float&),
72  asCALL_CDECL) < 0) {
73 
75  }
76 
77  if(engine->RegisterGlobalFunction(
78  "const int64 & min(const int64 &in a, const int64 &in b)",
79  asFUNCTIONPR(std::min<int64_t>, (const int64_t&, const int64_t&), const int64_t&),
80  asCALL_CDECL) < 0) {
81 
83  }
84 
85  // ------------------------------------ //
86  // max
87  if(engine->RegisterGlobalFunction(
88  "const float & max(const float &in a, const float &in b)",
89  asFUNCTIONPR(std::max<float>, (const float&, const float&), const float&),
90  asCALL_CDECL) < 0) {
91 
93  }
94 
95  if(engine->RegisterGlobalFunction(
96  "const int64 & max(const int64 &in a, const int64 &in b)",
97  asFUNCTIONPR(std::max<int64_t>, (const int64_t&, const int64_t&), const int64_t&),
98  asCALL_CDECL) < 0) {
99 
101  }
102 
103  // ------------------------------------ //
104  // round
105  if(engine->RegisterGlobalFunction(
106  "int round(double value)", asFUNCTION(RoundProxy), asCALL_CDECL) < 0) {
107 
109  }
110  if(engine->RegisterGlobalFunction(
111  "int round(float value)", asFUNCTION(RoundProxy2), asCALL_CDECL) < 0) {
112 
114  }
115 
116  // ------------------------------------ //
117  // sign
118  if(engine->RegisterGlobalFunction(
119  "float sign(float value)", asFUNCTION(SignProxy), asCALL_CDECL) < 0) {
120 
122  }
123 
124 
125  // ------------------------------------ //
126  // Extra string helpers
127  if(engine->RegisterGlobalFunction("string CharacterToString(int32 character)",
128  asFUNCTION(CharacterToStringProxy), asCALL_CDECL) < 0) {
129 
131  }
132 
133 
134  return true;
135 }
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 347 of file OgreBind.cpp.

348 {
349 
350  if(engine->RegisterObjectType("Matrix4", sizeof(Ogre::Matrix4),
351  asOBJ_VALUE | asGetTypeTraits<Ogre::Matrix4>() | asOBJ_POD |
352  asOBJ_APP_CLASS_ALLFLOATS) < 0) {
354  }
355 
356  if(engine->RegisterObjectBehaviour("Matrix4", asBEHAVE_CONSTRUCT,
357  "void f(const Vector3 &in trans, const Vector3 &in scale = Ogre::Vector3(1, 1, 1), "
358  "const Quaternion &in orientation = Ogre::Quaternion::IDENTITY)",
359  asFUNCTION(MatrixProxy), asCALL_CDECL_OBJFIRST) < 0) {
361  }
362 
363  if(engine->RegisterObjectMethod("Matrix4",
364  "void makeTransform(const Vector3 &in trans, const Vector3 &in scale = "
365  "Ogre::Vector3(1, 1, 1), const Quaternion &in orientation = "
366  "Ogre::Quaternion::IDENTITY)",
367  asMETHOD(Ogre::Matrix4, makeTransform), asCALL_THISCALL) < 0) {
369  }
370 
371  if(engine->RegisterObjectMethod("Matrix4", "Vector3 getTrans() const",
372  asMETHODPR(Ogre::Matrix4, getTrans, () const, Ogre::Vector3),
373  asCALL_THISCALL) < 0) {
375  }
376 
377 
378  if(engine->RegisterObjectMethod("Matrix4", "Quaternion extractQuaternion() const",
379  asMETHOD(Ogre::Matrix4, extractQuaternion), asCALL_THISCALL) < 0) {
381  }
382 
383 
384 
385  if(engine->SetDefaultNamespace("Ogre::Matrix4") < 0) {
387  }
388 
389  if(engine->RegisterGlobalProperty("const Ogre::Matrix4 IDENTITY",
390  const_cast<Ogre::Matrix4*>(&Ogre::Matrix4::IDENTITY)) < 0) {
392  }
393 
394  if(engine->SetDefaultNamespace("Ogre") < 0) {
396  }
397 
398 
399  return true;
400 }
void MatrixProxy(void *memory, const Ogre::Vector3 &position, const Ogre::Vector3 &scale, const Ogre::Quaternion &orientation)
Definition: OgreBind.cpp:32
<