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  AnimationSystem
 Handles updating time of Ogre animations. More...
 
class  AnimationTrack
 
class  AppDef
 
class  AudioSource
 Small ReferenceCounted wrapper around an audio source. More...
 
class  AutoUpdateableObject
 
class  AV1Codec
 AOM AV1 video codec. More...
 
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  BaseRenderable
 
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
 
struct  ClusterBlockHeader
 A block inside a cluster. More...
 
class  Codec
 Base codec interface for all supported video and audio codecs. More...
 
class  CommandHandler
 Handles all commands sent by the players on the server. More...
 
class  CommandSender
 Represents an entity that can execute commands. More...
 
struct  CommonVariableLengthValue
 
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  CrashHandler
 An orchestrator for crashing. 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
 
struct  DecodedFrame
 Holds decoded data. This is only valid until the frame receive callback ends. More...
 
class  Degree
 Represents an angle in degrees. More...
 
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...
 
struct  EBMLElement
 A basic EBML element. More...
 
struct  EBMLLengthValue
 Decodes a length encoded in EBML. More...
 
struct  EBMLLIdentifierValue
 Decodes an indentifier encoded in EBML. 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  FloatEventData
 Data for EVENT_TYPE_ENGINE_TICK and all others that have only int data. More...
 
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
 
struct  GUIOverlayInitializationData
 
class  GUIOverlayRenderer
 
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
 
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  MasterServer
 
class  MasterServerApplication
 
struct  MasterServerInformation
 
class  Material
 
struct  Matrix3
 A 3x3 rotation and scale matrix. More...
 
struct  Matrix4
 A 4x4 matrix type. More...
 
class  MatroskaParser
 Basic parser for Matroska (.mkv) container for use with GUI::VideoPlayer. More...
 
class  MD5
 
class  Mesh
 
class  Model
 Entity has a model. More...
 
class  ModelPropertiesSystem
 Handles properties of 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  ObjectAnimationHandler
 
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  OpusCodec
 Opus audio codec. More...
 
class  OutOfMemoryHandler
 
class  PermissionsGroup
 
class  PermissionsManager
 
class  PermissionsNode
 
class  PermissionsPlayer
 
class  PerWorldData
 A base type for data classes that need to be associated with a GameWorld. More...
 
class  PhysicalMaterial
 
class  PhysicalWorld
 
class  Physics
 Entity has a physical component. More...
 
class  PhysicsBody
 This is an instance of a collision body. More...
 
class  PhysicsConstraint
 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  PhysicsDebugDrawer
 
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...
 
struct  Plane
 A plane represented by a normal and a distance. More...
 
class  Position
 Entity has position and direction it is looking at. More...
 
class  PositionStateSystem
 
struct  PotentiallySetIndex
 
struct  Quaternion
 A Quaternion type to make quaternion specific operations easier to access. 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  Radian
 Represents an angle in radians. More...
 
class  Random
 Random number generator based on Mersenne Twister. More...
 
struct  Ray
 Ray starting from an origin with a direction. 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  Renderable
 Implements a basic renderable rendering a Mesh with a Material. More...
 
class  RenderingPositionSystem
 Moves nodes of entities that have their positions changed. More...
 
class  RenderingStatistics
 Mainly a FPS limiter. More...
 
class  RenderNode
 Entity has a scene node. More...
 
class  RenderNodePropertiesSystem
 Handles properties of scene objects 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  RotatingBufferHelper
 Helper for having a few BSF buffers for writing in turn. More...
 
class  Scene
 
class  SceneAttachable
 Base class for all objects attachable to a SceneNode. More...
 
class  SceneNode
 A node in the Scene used to position renderables and other SceneNodes. 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
 
class  Shader
 
struct  SimpleAnimation
 Contains an animation 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  Texture
 
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
 Helper class for getting the time. More...
 
class  TimingMonitor
 
struct  TimingMonitorClock
 
struct  Transform
 World transform for an object. More...
 
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  VorbisCodec
 Vorbis audio codec. More...
 
class  Window
 
struct  WindowDataDetails
 
class  WireData
 
struct  WorldNetworkSettings
 
class  XiphLacing
 

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 PhysicsMaterialManifoldCallback = void(*)(PhysicalWorld &world, PhysicsBody &, PhysicsBody &, const btPersistentManifold &)
 
using AccessFlags = uint32_t
 
using MillisecondDuration = std::chrono::duration< int64_t, std::milli >
 
using MicrosecondDuration = std::chrono::duration< int64_t, std::micro >
 
using SecondDuration = std::chrono::duration< float, std::ratio< 1 > >
 
using PreciseSecondDuration = std::chrono::duration< double, std::ratio< 1 > >
 
using WantedClockType = std::chrono::high_resolution_clock
 
using TimePoint = WantedClockType::time_point
 

Enumerations

enum  EulerAngleOrder {
  EulerAngleOrder::XYZ, EulerAngleOrder::XZY, EulerAngleOrder::YXZ, EulerAngleOrder::YZX,
  EulerAngleOrder::ZXY, EulerAngleOrder::ZYX
}
 
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::Camera,
  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_INIT, EVENT_TYPE_RELEASE, EVENT_TYPE_TEST, 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 }
 
enum  YUV_COLOUR_SPACE { YUV_COLOUR_SPACE::BT_601 = 0 }
 

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)
 
Matrix3 operator* (float lhs, const Matrix3 &rhs)
 
DLLEXPORT std::string_view GetMimeTypeFromPath (const std::string_view &path)
 This returns a mime type based on the file extension. More...
 
constexpr Float3 operator* (const Float3 &lhs, const Quaternion &rhs) noexcept
 
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 bs::Vector3 &data)
 
DLLEXPORT sf::Packet & operator>> (sf::Packet &packet, bs::Vector3 &data)
 
DLLEXPORT sf::Packet & operator<< (sf::Packet &packet, const bs::Plane &data)
 
DLLEXPORT sf::Packet & operator>> (sf::Packet &packet, bs::Plane &data)
 
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...
 
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...
 
bool BindEntity (asIScriptEngine *engine)
 
bool BindTypes (asIScriptEngine *engine)
 
bool BindPhysics (asIScriptEngine *engine)
 
bool BindGUI (asIScriptEngine *engine)
 
bool BindEngineCommon (asIScriptEngine *engine)
 
bool BindRendering (asIScriptEngine *engine)
 
bool BindStandardFunctions (asIScriptEngine *engine)
 Binds standard and other utilities like: std::min, std::max etc. 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 BindShader (asIScriptEngine *engine)
 
bool BindTexture (asIScriptEngine *engine)
 
bool BindMaterial (asIScriptEngine *engine)
 
bool BindSceneNode (asIScriptEngine *engine)
 
bool BindScene (asIScriptEngine *engine)
 
bool BindRenderable (asIScriptEngine *engine)
 
bool BindMathOperations (asIScriptEngine *engine)
 
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 BindGraphics (asIScriptEngine *engine)
 
bool BindEngine (asIScriptEngine *engine)
 
bool BindApplication (asIScriptEngine *engine)
 
bool BindGameModule (asIScriptEngine *engine)
 
bool BindDelegates (asIScriptEngine *engine)
 
bool BindAudioSource (asIScriptEngine *engine)
 
bool BindSound (asIScriptEngine *engine)
 
bool BindFileSystem (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 BindShape (asIScriptEngine *engine)
 
bool BindConstraint (asIScriptEngine *engine)
 
bool BindBody (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 BindQuaternion (asIScriptEngine *engine)
 
bool BindInt2 (asIScriptEngine *engine)
 
bool BindInt3 (asIScriptEngine *engine)
 
bool BindRadian (asIScriptEngine *engine)
 
bool BindDegree (asIScriptEngine *engine)
 
bool BindMatrix4 (asIScriptEngine *engine)
 
bool BindRay (asIScriptEngine *engine)
 
bool BindPlane (asIScriptEngine *engine)
 
bool BindTypeDefs (asIScriptEngine *engine)
 
bool PassParameterToCustomRun (std::unique_ptr< CustomScriptRun > &run, uint32_t value)
 
bool PassParameterToCustomRun (std::unique_ptr< CustomScriptRun > &run, uint8_t value)
 
bool PassParameterToCustomRun (std::unique_ptr< CustomScriptRun > &run, float value)
 
bool PassParameterToCustomRun (std::unique_ptr< CustomScriptRun > &run, double value)
 
bool PassParameterToCustomRun (std::unique_ptr< CustomScriptRun > &run, uint64_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, bool constversion)
 
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 (NewtonCollision, "NewtonCollision@")
 
void RunNewThread (TaskThread *thisthread)
 
DLLEXPORT void RegisterOgreOnThread ()
 
DLLEXPORT void UnregisterOgreOnThread ()
 
void RunTaskQueuerThread (ThreadingManager *manager)
 
void SetThreadName (TaskThread *thread, const std::string &name)
 
DLLEXPORT bool YUVToRGBA (const std::array< const uint8_t *, 3 > &planes, const std::array< int, 3 > &strides, const std::array< std::tuple< int, int >, 3 > &planesizes, bool bytesare16bit, uint8_t *target, size_t width, size_t height, YUV_COLOUR_SPACE colourtype=YUV_COLOUR_SPACE::BT_601)
 Converts a few kinds of supported YUV formats to RGBA. More...
 

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 DEFAULT_HEADLESS_MAX_UPDATES_PER_SECOND = 20
 Max "FPS" in headless mode. More...
 
constexpr auto DEFAULT_HEADLESS_TICK_INTERVAL
 Number of milliseconds between engine ticks in headless mode (no gui) More...
 
constexpr auto INTERPOLATION_TIME = 0.1f
 Time in seconds to interpolate entities between states. More...
 
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 auto BITS_IN_BYTE = 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 HALF_PI = PI / 2
 
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 KEPT_STATES_COUNT = 5
 
static const std::map< std::string, EVENT_TYPEEventListenerNameToEventMap
 
static const std::map< std::string, EVENT_TYPEEventListenerCommonNameToEventMap
 
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 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 18 of file ThreadSafe.h.

◆ MicrosecondDuration

using Leviathan::MicrosecondDuration = typedef std::chrono::duration<int64_t, std::micro>

Definition at line 15 of file TimeIncludes.h.

◆ MillisecondDuration

using Leviathan::MillisecondDuration = typedef std::chrono::duration<int64_t, std::milli>

Definition at line 14 of file TimeIncludes.h.

◆ Mutex

using Leviathan::Mutex = typedef std::mutex

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

◆ PhysicsMaterialManifoldCallback

using Leviathan::PhysicsMaterialManifoldCallback = typedef void (*)( PhysicalWorld& world, PhysicsBody&, PhysicsBody&, const btPersistentManifold&)

This function is called for each manifold contact point that is between the two bodies This is not implemented: If this returns false the manifold point is destroyed to retrigger AABB callback

Definition at line 36 of file PhysicalMaterial.h.

◆ PreciseSecondDuration

using Leviathan::PreciseSecondDuration = typedef std::chrono::duration<double, std::ratio<1> >

Definition at line 17 of file TimeIncludes.h.

◆ RecursiveLock

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

Definition at line 19 of file ThreadSafe.h.

◆ RecursiveMutex

using Leviathan::RecursiveMutex = typedef std::recursive_mutex

Definition at line 17 of file ThreadSafe.h.

◆ SecondDuration

using Leviathan::SecondDuration = typedef std::chrono::duration<float, std::ratio<1> >

Definition at line 16 of file TimeIncludes.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 164 of file ThreadSafe.h.

◆ ThreadSafeRecursive

Object supports recursive locking.

Less efficient than ThreadSafe

Definition at line 169 of file ThreadSafe.h.

◆ TimePoint

using Leviathan::TimePoint = typedef WantedClockType::time_point

Definition at line 20 of file TimeIncludes.h.

◆ VoidPtrBlock

Definition at line 389 of file DataBlock.h.

◆ WantedClockType

using Leviathan::WantedClockType = typedef std::chrono::high_resolution_clock

Definition at line 19 of file TimeIncludes.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 
Camera 
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'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'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.

◆ EulerAngleOrder

Values that represent in which order are euler angles applied when used in transformations.

Enumerator
XYZ 
XZY 
YXZ 
YZX 
ZXY 
ZYX 

Definition at line 23 of file Matrix.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_INIT 
EVENT_TYPE_RELEASE 
EVENT_TYPE_TEST 
EVENT_TYPE_ALL 

Definition at line 12 of file Event.h.

12  {
13  EVENT_TYPE_ERROR = 0,
33  // EVENT_TYPE_FRAME_END,
37 
39 };

◆ 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 };
\ 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, 'like this'.

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

◆ YUV_COLOUR_SPACE

Enumerator
BT_601 

Definition at line 11 of file YUVToRGB.h.

Function Documentation

◆ BindApplication()

bool Leviathan::BindApplication ( asIScriptEngine *  engine)

Definition at line 697 of file CommonEngineBind.cpp.

698 {
699 
700  if(engine->RegisterEnum("NETWORKED_TYPE") < 0) {
702  }
703 
708 
709  if(engine->RegisterObjectType("LeviathanApplication", 0, asOBJ_REF | asOBJ_NOCOUNT) < 0) {
711  }
712 
713  // Global get function //
714  if(engine->RegisterGlobalFunction("LeviathanApplication& GetLeviathanApplication()",
715  asFUNCTION(LeviathanApplication::Get), asCALL_CDECL) < 0) {
717  }
718 
719  if(engine->RegisterObjectMethod("LeviathanApplication", "void MarkAsClosing()",
720  asMETHOD(LeviathanApplication, MarkAsClosing), asCALL_THISCALL) < 0) {
722  }
723 
724  if(engine->RegisterObjectMethod("LeviathanApplication", "bool Quitting()",
725  asMETHOD(LeviathanApplication, Quitting), asCALL_THISCALL) < 0) {
727  }
728 
729  if(engine->RegisterObjectMethod("LeviathanApplication",
730  "NETWORKED_TYPE GetProgramNetType() const",
731  asMETHOD(LeviathanApplication, GetProgramNetType), asCALL_THISCALL) < 0) {
733  }
734 
735  return true;
736 }
#define ANGELSCRIPT_REGISTER_ENUM_VALUE(enum, x)
Definition: BindHelpers.h:107
NETWORKED_TYPE
Type of networked application.
Definition: CommonNetwork.h:22
#define ANGELSCRIPT_REGISTERFAIL
Definition: BindHelpers.h:12
Base class for all leviathan programs.
Definition: Application.h:16

◆ BindAudioSource()

bool Leviathan::BindAudioSource ( asIScriptEngine *  engine)

Definition at line 777 of file CommonEngineBind.cpp.

778 {
780 
781  if(engine->RegisterObjectMethod("AudioSource", "void Resume()",
782  asMETHOD(AudioSource, Resume), asCALL_THISCALL) < 0) {
784  }
785 
786  if(engine->RegisterObjectMethod(
787  "AudioSource", "void Pause()", asMETHOD(AudioSource, Pause), asCALL_THISCALL) < 0) {
789  }
790 
791  if(engine->RegisterObjectMethod(
792  "AudioSource", "void Stop()", asMETHOD(AudioSource, Stop), asCALL_THISCALL) < 0) {
794  }
795 
796  if(engine->RegisterObjectMethod("AudioSource", "bool IsPlaying() const",
797  asMETHOD(AudioSource, IsPlaying), asCALL_THISCALL) < 0) {
799  }
800 
801  if(engine->RegisterObjectMethod("AudioSource", "void SetVolume(float volume)",
802  asMETHOD(AudioSource, SetVolume), asCALL_THISCALL) < 0) {
804  }
805 
806  if(engine->RegisterObjectMethod("AudioSource", "bool HasInternalSource() const",
807  asMETHOD(AudioSource, HasInternalSource), asCALL_THISCALL) < 0) {
809  }
810 
811  return true;
812 }
#define ANGELSCRIPT_REGISTER_REF_TYPE(RegisterName, ClassName)
Definition: BindHelpers.h:92
#define ANGELSCRIPT_REGISTERFAIL
Definition: BindHelpers.h:12
Small ReferenceCounted wrapper around an audio source.
Definition: AudioSource.h:16

◆ BindBody()

bool Leviathan::BindBody ( asIScriptEngine *  engine)

Definition at line 75 of file PhysicsBind.cpp.

76 {
78 
79  if(engine->RegisterObjectMethod("PhysicsBody", "Float3 GetVelocity() const",
80  asMETHODPR(PhysicsBody, GetVelocity, () const, Float3), asCALL_THISCALL) < 0) {
82  }
83 
84  if(engine->RegisterObjectMethod("PhysicsBody",
85  "void SetVelocity(const Float3 &in velocity) const",
86  asMETHOD(PhysicsBody, SetVelocity), asCALL_THISCALL) < 0) {
88  }
89 
90  if(engine->RegisterObjectMethod("PhysicsBody", "Float3 GetAngularVelocity() const",
91  asMETHODPR(PhysicsBody, GetAngularVelocity, () const, Float3),
92  asCALL_THISCALL) < 0) {
94  }
95 
96  if(engine->RegisterObjectMethod("PhysicsBody",
97  "void SetAngularVelocity(const Float3 &in omega) const",
98  asMETHOD(PhysicsBody, SetAngularVelocity), asCALL_THISCALL) < 0) {
100  }
101 
102  if(engine->RegisterObjectMethod("PhysicsBody", "void ClearVelocity() const",
103  asMETHOD(PhysicsBody, ClearVelocity), asCALL_THISCALL) < 0) {
105  }
106 
107  if(engine->RegisterObjectMethod("PhysicsBody", "Float3 GetTorque() const",
108  asMETHODPR(PhysicsBody, GetTorque, () const, Float3), asCALL_THISCALL) < 0) {
110  }
111 
112  if(engine->RegisterObjectMethod("PhysicsBody", "void ApplyTorque(const Float3 &in torque)",
113  asMETHOD(PhysicsBody, ApplyTorque), asCALL_THISCALL) < 0) {
115  }
116 
117  if(engine->RegisterObjectMethod("PhysicsBody", "void SetMass(float mass)",
118  asMETHOD(PhysicsBody, SetMass), asCALL_THISCALL) < 0) {
120  }
121 
122  if(engine->RegisterObjectMethod("PhysicsBody", "float get_Mass() const",
123  asMETHOD(PhysicsBody, GetMass), asCALL_THISCALL) < 0) {
125  }
126 
127  if(engine->RegisterObjectMethod("PhysicsBody", "PhysicsShape@ get_Shape() const",
128  asMETHOD(PhysicsBody, GetShapeWrapper), asCALL_THISCALL) < 0) {
130  }
131 
132  if(engine->RegisterObjectMethod("PhysicsBody", "PhysicsShape@ GetShape() const",
133  asMETHOD(PhysicsBody, GetShapeWrapper), asCALL_THISCALL) < 0) {
135  }
136 
137  if(engine->RegisterObjectMethod("PhysicsBody",
138  "bool SetPosition(const Float3 &in pos, const Quaternion &in orientation)",
139  asMETHOD(PhysicsBody, SetPosition), asCALL_THISCALL) < 0) {
141  }
142 
143  if(engine->RegisterObjectMethod("PhysicsBody", "Float3 GetPosition() const",
144  asMETHOD(PhysicsBody, GetPosition), asCALL_THISCALL) < 0) {
146  }
147 
148  if(engine->RegisterObjectMethod("PhysicsBody",
149  "bool SetOnlyOrientation(const Quaternion &in orientation)",
150  asMETHOD(PhysicsBody, SetOnlyOrientation), asCALL_THISCALL) < 0) {
152  }
153 
154  if(engine->RegisterObjectMethod("PhysicsBody",
155  "void GiveImpulse(const Float3 &in deltaspeed, const Float3 &in point = Float3(0))",
156  asMETHOD(PhysicsBody, GiveImpulse), asCALL_THISCALL) < 0) {
158  }
159 
160  if(engine->RegisterObjectMethod("PhysicsBody",
161  "void SetDamping(float linear, float angular)", asMETHOD(PhysicsBody, SetDamping),
162  asCALL_THISCALL) < 0) {
164  }
165 
166  if(engine->RegisterObjectMethod("PhysicsBody", "void SetFriction(float friction)",
167  asMETHOD(PhysicsBody, SetFriction), asCALL_THISCALL) < 0) {
169  }
170 
171  if(engine->RegisterObjectMethod("PhysicsBody",
172  "void ConstraintMovementAxises(const Float3 &in movement = Float3(1, 0, 1), const "
173  "Float3 &in rotation = Float3(0, 1, 0))",
174  asMETHOD(PhysicsBody, ConstraintMovementAxises), asCALL_THISCALL) < 0) {
176  }
177 
178  return true;
179 }
#define ANGELSCRIPT_REGISTER_REF_TYPE(RegisterName, ClassName)
Definition: BindHelpers.h:92
This is an instance of a collision body.
Definition: PhysicsBody.h:77
#define ANGELSCRIPT_REGISTERFAIL
Definition: BindHelpers.h:12

◆ BindComponentTypeID()

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

Helper for BindComponentTypes.

Definition at line 130 of file EntityBind.cpp.

131 {
132  if(engine->SetDefaultNamespace(name) < 0) {
134  }
135 
136  if(engine->RegisterGlobalProperty("const uint16 TYPE", value) < 0) {
137 
139  }
140 
141  if(engine->SetDefaultNamespace("") < 0) {
143  }
144 
145  return true;
146 }
#define ANGELSCRIPT_REGISTERFAIL
Definition: BindHelpers.h:12

◆ BindComponentTypes()

bool Leviathan::BindComponentTypes ( asIScriptEngine *  engine)

Definition at line 148 of file EntityBind.cpp.

149 {
150  // ------------------------------------ //
151  // Position
152  if(engine->RegisterObjectType("Position", 0, asOBJ_REF | asOBJ_NOCOUNT) < 0) {
154  }
155 
156  if(engine->RegisterObjectProperty("Position", "bool Marked", asOFFSET(Position, Marked)) <
157  0) {
159  }
160 
161  if(engine->RegisterObjectProperty(
162  "Position", "Float3 _Position", asOFFSET(Position, Members._Position)) < 0) {
164  }
165 
166  if(engine->RegisterObjectProperty("Position", "Quaternion _Orientation",
167  asOFFSET(Position, Members._Orientation)) < 0) {
169  }
170 
171  if(!BindComponentTypeID(engine, "Position", &PositionTYPEProxy))
172  return false;
173 
174  // ------------------------------------ //
175  // Physics
176  if(engine->RegisterObjectType("Physics", 0, asOBJ_REF | asOBJ_NOCOUNT) < 0) {
178  }
179 
180  // Currently does nothing
181  if(engine->RegisterObjectProperty("Physics", "bool Marked", asOFFSET(Physics, Marked)) <
182  0) {
184  }
185 
186  if(engine->RegisterObjectMethod("Physics", "PhysicsBody@ get_Body() const",
187  asMETHOD(Physics, GetBodyWrapper), asCALL_THISCALL) < 0) {
189  }
190 
191  if(engine->RegisterObjectMethod("Physics",
192  "PhysicsBody@ CreatePhysicsBody(PhysicalWorld@ world, PhysicsShape@ shape, "
193  "float mass, int physicsmaterialid = -1)",
194  asMETHOD(Physics, CreatePhysicsBodyWrapper), asCALL_THISCALL) < 0) {
196  }
197 
198  if(engine->RegisterObjectMethod("Physics",
199  "bool ChangeShape(PhysicalWorld@ world, PhysicsShape@ shape)",
200  asMETHOD(Physics, ChangeShapeWrapper), asCALL_THISCALL) < 0) {
202  }
203 
204  if(engine->RegisterObjectMethod("Physics", "void JumpTo(Position@ positiontosync)",
205  asMETHOD(Physics, JumpTo), asCALL_THISCALL) < 0) {
207  }
208 
209  if(engine->RegisterObjectMethod("Physics", "void Release(PhysicalWorld@ world)",
210  asMETHOD(Physics, Release), asCALL_THISCALL) < 0) {
212  }
213 
214  if(!BindComponentTypeID(engine, "Physics", &PhysicsTYPEProxy))
215  return false;
216 
217  // ------------------------------------ //
218  // RenderNode
219  if(engine->RegisterObjectType("RenderNode", 0, asOBJ_REF | asOBJ_NOCOUNT) < 0) {
221  }
222 
223  if(engine->RegisterObjectProperty(
224  "RenderNode", "bool Marked", asOFFSET(RenderNode, Marked)) < 0) {
226  }
227 
228  if(engine->RegisterObjectProperty(
229  "RenderNode", "Float3 Scale", asOFFSET(RenderNode, Scale)) < 0) {
231  }
232 
233  if(engine->RegisterObjectMethod("RenderNode", "SceneNode@ get_Node()",
234  asFUNCTION(RenderNodeGetNode), asCALL_CDECL_OBJFIRST) < 0) {
236  }
237 
238  if(engine->RegisterObjectProperty(
239  "RenderNode", "bool Hidden", asOFFSET(RenderNode, Hidden)) < 0) {
241  }
242 
243  if(!BindComponentTypeID(engine, "RenderNode", &RenderNodeTYPEProxy))
244  return false;
245 
246  // ------------------------------------ //
247  // Sendable
248  if(engine->RegisterObjectType("Sendable", 0, asOBJ_REF | asOBJ_NOCOUNT) < 0) {
250  }
251 
252  if(engine->RegisterObjectProperty("Sendable", "bool Marked", asOFFSET(Sendable, Marked)) <
253  0) {
255  }
256 
257  if(!BindComponentTypeID(engine, "Sendable", &SendableTYPEProxy))
258  return false;
259 
260  // ------------------------------------ //
261  // Received
262  if(engine->RegisterObjectType("Received", 0, asOBJ_REF | asOBJ_NOCOUNT) < 0) {
264  }
265 
266  if(engine->RegisterObjectProperty("Received", "bool Marked", asOFFSET(Received, Marked)) <
267  0) {
269  }
270 
271  if(!BindComponentTypeID(engine, "Received", &ReceivedTYPEProxy))
272  return false;
273 
274  // ------------------------------------ //
275  // Model
276  if(engine->RegisterObjectType("Model", 0, asOBJ_REF | asOBJ_NOCOUNT) < 0) {
278  }
279 
280  if(engine->RegisterObjectProperty("Model", "bool Marked", asOFFSET(Model, Marked)) < 0) {
282  }
283 
284  if(!BindComponentTypeID(engine, "Model", &ModelTYPEProxy))
285  return false;
286 
287  if(engine->RegisterObjectMethod("Model", "Renderable@ get_GraphicalObject()",
288  asFUNCTION(ModelGetGraphicalObject), asCALL_CDECL_OBJFIRST) < 0) {
290  }
291 
292  if(engine->RegisterObjectMethod("Model", "Material@ get_ObjectMaterial()",
293  asFUNCTION(ModelGetObjectMaterial), asCALL_CDECL_OBJFIRST) < 0) {
295  }
296 
297  if(engine->RegisterObjectMethod("Model", "void set_ObjectMaterial(Material@ material)",
298  asFUNCTION(ModelSetObjectMaterial), asCALL_CDECL_OBJFIRST) < 0) {
300  }
301 
302  if(engine->RegisterObjectProperty("Model", "string MeshName", asOFFSET(Model, MeshName)) <
303  0) {
305  }
306 
307  // ------------------------------------ //
308  // BoxGeometry
309  if(engine->RegisterObjectType("BoxGeometry", 0, asOBJ_REF | asOBJ_NOCOUNT) < 0) {
311  }
312 
313  if(engine->RegisterObjectProperty(
314  "BoxGeometry", "bool Marked", asOFFSET(BoxGeometry, Marked)) < 0) {
316  }
317 
318  if(!BindComponentTypeID(engine, "BoxGeometry", &BoxGeometryTYPEProxy))
319  return false;
320 
321  // // ------------------------------------ //
322  // // ManualObject
323  // if(engine->RegisterObjectType("ManualObject", 0, asOBJ_REF | asOBJ_NOCOUNT) < 0) {
324  // ANGELSCRIPT_REGISTERFAIL;
325  // }
326 
327  // if(engine->RegisterObjectProperty(
328  // "ManualObject", "bool Marked", asOFFSET(ManualObject, Marked)) < 0) {
329  // ANGELSCRIPT_REGISTERFAIL;
330  // }
331 
332  // if(!BindComponentTypeID(engine, "ManualObject", &ManualObjectTYPEProxy))
333  // return false;
334 
335  // ------------------------------------ //
336  // Camera
337  if(engine->RegisterObjectType("Camera", 0, asOBJ_REF | asOBJ_NOCOUNT) < 0) {
339  }
340 
341  if(engine->RegisterObjectProperty("Camera", "bool Marked", asOFFSET(Camera, Marked)) < 0) {
343  }
344 
345  if(engine->RegisterObjectProperty("Camera", "uint8 FOV", asOFFSET(Camera, FOV)) < 0) {
347  }
348 
349  if(engine->RegisterObjectProperty(
350  "Camera", "bool SoundPerceiver", asOFFSET(Camera, SoundPerceiver)) < 0) {
352  }
353 
354  if(!BindComponentTypeID(engine, "Camera", &CameraTYPEProxy))
355  return false;
356 
357 
358  // // ------------------------------------ //
359  // // Plane
360  // if(engine->RegisterObjectType("Plane", 0, asOBJ_REF | asOBJ_NOCOUNT) < 0) {
361  // ANGELSCRIPT_REGISTERFAIL;
362  // }
363 
364  // if(engine->RegisterObjectProperty("Plane", "bool Marked", asOFFSET(Plane, Marked)) < 0)
365  // {
366  // ANGELSCRIPT_REGISTERFAIL;
367  // }
368 
369  // if(!BindComponentTypeID(engine, "Plane", &PlaneTYPEProxy))
370  // return false;
371 
372  // if(engine->RegisterObjectProperty(
373  // "Plane", "Ogre::Item@ GraphicalObject", asOFFSET(Plane, GraphicalObject)) < 0) {
374  // ANGELSCRIPT_REGISTERFAIL;
375  // }
376 
377  // ------------------------------------ //
378  // Animated
379  if(engine->RegisterObjectType("Animated", 0, asOBJ_REF | asOBJ_NOCOUNT) < 0) {
381  }
382 
383  if(engine->RegisterObjectProperty("Animated", "bool Marked", asOFFSET(Animated, Marked)) <
384  0) {
386  }
387 
388  if(!BindComponentTypeID(engine, "Animated", &AnimatedTYPEProxy))
389  return false;
390 
391  // if(engine->RegisterObjectProperty("Animated", "Ogre::Item@ GraphicalObject",
392  // asOFFSET(Animated, GraphicalObject)) < 0) {
393  // ANGELSCRIPT_REGISTERFAIL;
394  // }
395 
396  // ------------------------------------ //
397  // SimpleAnimation
398  if(engine->RegisterObjectType("SimpleAnimation", sizeof(SimpleAnimation),
399  asOBJ_VALUE | asGetTypeTraits<SimpleAnimation>()) < 0) {
401  }
402  if(engine->RegisterObjectBehaviour("SimpleAnimation", asBEHAVE_CONSTRUCT,
403  "void f(const string &in name)", asFUNCTION(SimpleAnimationConstructorProxy),
404  asCALL_CDECL_OBJFIRST) < 0) {
406  }
407  if(engine->RegisterObjectBehaviour("SimpleAnimation", asBEHAVE_DESTRUCT, "void f()",
408  asFUNCTION(SimpleAnimationDestructorProxy), asCALL_CDECL_OBJFIRST) < 0) {
410  }
411 
412  if(engine->RegisterObjectProperty(
413  "SimpleAnimation", "bool Loop", asOFFSET(SimpleAnimation, Loop)) < 0) {
415  }
416 
417  if(engine->RegisterObjectProperty("SimpleAnimation", "float SpeedFactor",
418  asOFFSET(SimpleAnimation, SpeedFactor)) < 0) {
420  }
421 
422  if(engine->RegisterObjectProperty(
423  "SimpleAnimation", "bool Paused", asOFFSET(SimpleAnimation, Paused)) < 0) {
425  }
426 
427  // Animation helpers
428  if(engine->RegisterObjectMethod("Animated",
429  "void AddAnimation(const SimpleAnimation &in animation)",
430  asFUNCTION(AnimatedAddHelper), asCALL_CDECL_OBJFIRST) < 0) {
432  }
433 
434  if(engine->RegisterObjectMethod("Animated", "SimpleAnimation& GetAnimation(uint64 index)",
435  asFUNCTION(AnimatedGetHelper), asCALL_CDECL_OBJFIRST) < 0) {
437  }
438 
439  return true;
440 }
Entity is received from a server.
Definition: Components.h:170
static uint16_t SendableTYPEProxy
Definition: EntityBind.cpp:120
SceneNode * RenderNodeGetNode(RenderNode &self)
Definition: EntityBind.cpp:63
static uint16_t PhysicsTYPEProxy
Definition: EntityBind.cpp:117
static uint16_t ReceivedTYPEProxy
Definition: EntityBind.cpp:121
void SimpleAnimationDestructorProxy(void *memory)
Definition: EntityBind.cpp:43
Contains an animation for Animated component.
Definition: Components.h:257
static uint16_t BoxGeometryTYPEProxy
Definition: EntityBind.cpp:123
Material * ModelGetObjectMaterial(Model &self)
Definition: EntityBind.cpp:79
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:212
Entity has position and direction it is looking at.
Definition: Components.h:36
Entity has a scene node.
Definition: Components.h:82
void AnimatedAddHelper(Animated *self, const SimpleAnimation &animation)
Definition: EntityBind.cpp:48
Entity has a physical component.
Definition: Components.h:347
SimpleAnimation * AnimatedGetHelper(Animated *self, uint64_t index)
Definition: EntityBind.cpp:54
Entity has a model.
Definition: Components.h:233
static uint16_t AnimatedTYPEProxy
Definition: EntityBind.cpp:127
Properties that a camera entity has (will also need a Position component)
Definition: Components.h:714
static uint16_t ModelTYPEProxy
Definition: EntityBind.cpp:122
#define ANGELSCRIPT_REGISTERFAIL
Definition: BindHelpers.h:12
bool BindComponentTypeID(asIScriptEngine *engine, const char *name, uint16_t *value)
Helper for BindComponentTypes.
Definition: EntityBind.cpp:130
Entity plays animations on an Ogre::Item.
Definition: Components.h:296
void ModelSetObjectMaterial(Model &self, Material *newmaterial)
Definition: EntityBind.cpp:87
Entity is sendable to clients.
Definition: Components.h:115
Renderable * ModelGetGraphicalObject(Model &self)
Definition: EntityBind.cpp:71
static uint16_t PositionTYPEProxy
Definition: EntityBind.cpp:118
static uint16_t RenderNodeTYPEProxy
Definition: EntityBind.cpp:119
static uint16_t CameraTYPEProxy
Definition: EntityBind.cpp:124

◆ BindConstraint()

bool Leviathan::BindConstraint ( asIScriptEngine *  engine)

Definition at line 63 of file PhysicsBind.cpp.

64 {
66 
67  if(engine->RegisterObjectMethod("PhysicsConstraint", "bool Valid() const",
68  asMETHOD(PhysicsConstraint, Valid), asCALL_THISCALL) < 0) {
70  }
71 
72  return true;
73 }
#define ANGELSCRIPT_REGISTER_REF_TYPE(RegisterName, ClassName)
Definition: BindHelpers.h:92
This is an instance of a collision body.
#define ANGELSCRIPT_REGISTERFAIL
Definition: BindHelpers.h:12

◆ BindDataBlock()

bool Leviathan::BindDataBlock ( asIScriptEngine *  engine)

Definition at line 293 of file CommonEngineBind.cpp.

294 {
295  ANGELSCRIPT_REGISTER_REF_TYPE("ScriptSafeVariableBlock", ScriptSafeVariableBlock);
296 
297  // Some factories //
298  if(engine->RegisterObjectBehaviour("ScriptSafeVariableBlock", asBEHAVE_FACTORY,
299  "ScriptSafeVariableBlock@ f(const string &in blockname, const string &in value)",
300  asFUNCTION(ScriptSafeVariableBlockFactoryString), asCALL_CDECL) < 0) {
302  }
303 
304  if(engine->RegisterObjectBehaviour("ScriptSafeVariableBlock", asBEHAVE_FACTORY,
305  "ScriptSafeVariableBlock@ f(const string &in blockname, float value)",
306  asFUNCTION(ScriptSafeVariableBlockFactoryGeneric<float>), asCALL_CDECL) < 0) {
308  }
309 
310  if(engine->RegisterObjectBehaviour("ScriptSafeVariableBlock", asBEHAVE_FACTORY,
311  "ScriptSafeVariableBlock@ f(const string &in blockname, int value)",
312  asFUNCTION(ScriptSafeVariableBlockFactoryGeneric<int>), asCALL_CDECL) < 0) {
314  }
315 
316  if(engine->RegisterObjectBehaviour("ScriptSafeVariableBlock", asBEHAVE_FACTORY,
317  "ScriptSafeVariableBlock@ f(const string &in blockname, double value)",
318  asFUNCTION(ScriptSafeVariableBlockFactoryGeneric<double>), asCALL_CDECL) < 0) {
320  }
321 
322  if(engine->RegisterObjectBehaviour("ScriptSafeVariableBlock", asBEHAVE_FACTORY,
323  "ScriptSafeVariableBlock@ f(const string &in blockname, int8 value)",
324  asFUNCTION(ScriptSafeVariableBlockFactoryGeneric<char>), asCALL_CDECL) < 0) {
326  }
327 
328  if(engine->RegisterObjectBehaviour("ScriptSafeVariableBlock", asBEHAVE_FACTORY,
329  "ScriptSafeVariableBlock@ f(const string &in blockname, bool value)",
330  asFUNCTION(ScriptSafeVariableBlockFactoryGeneric<bool>), asCALL_CDECL) < 0) {
332  }
333 
334  // Implicit casts for normal types //
335  if(engine->RegisterObjectMethod("ScriptSafeVariableBlock", "string opImplConv() const",
336  WRAP_MFN(ScriptSafeVariableBlock, ConvertAndReturnVariable<std::string>),
337  asCALL_GENERIC) < 0) {
339  }
340 
341  if(engine->RegisterObjectMethod("ScriptSafeVariableBlock", "int opImplConv() const",
342  WRAP_MFN(ScriptSafeVariableBlock, ConvertAndReturnVariable<int>),
343  asCALL_GENERIC) < 0) {
345  }
346 
347  if(engine->RegisterObjectMethod("ScriptSafeVariableBlock", "int8 opImplConv() const",
348  WRAP_MFN(ScriptSafeVariableBlock, ConvertAndReturnVariable<char>),
349  asCALL_GENERIC) < 0) {
351  }
352 
353  if(engine->RegisterObjectMethod("ScriptSafeVariableBlock", "float opImplConv() const",
354  WRAP_MFN(ScriptSafeVariableBlock, ConvertAndReturnVariable<float>),
355  asCALL_GENERIC) < 0) {
357  }
358 
359  if(engine->RegisterObjectMethod("ScriptSafeVariableBlock", "double opImplConv() const",
360  WRAP_MFN(ScriptSafeVariableBlock, ConvertAndReturnVariable<double>),
361  asCALL_GENERIC) < 0) {
363  }
364 
365  if(engine->RegisterObjectMethod("ScriptSafeVariableBlock", "bool opImplConv() const",
366  WRAP_MFN(ScriptSafeVariableBlock, ConvertAndReturnVariable<bool>),
367  asCALL_GENERIC) < 0) {
369  }
370 
371  // type check //
372  if(engine->RegisterObjectMethod("ScriptSafeVariableBlock", "bool IsValidType()",
373  asMETHOD(ScriptSafeVariableBlock, IsValidType), asCALL_THISCALL) < 0) {
375  }
376 
377 
378  return true;
379 }
#define ANGELSCRIPT_REGISTER_REF_TYPE(RegisterName, ClassName)
Definition: BindHelpers.h:92
Reference counted version for scripts of VariableBlock.
Definition: DataBlock.h:840
#define ANGELSCRIPT_REGISTERFAIL
Definition: BindHelpers.h:12
ScriptSafeVariableBlock * ScriptSafeVariableBlockFactoryString(const std::string &blockname, const std::string &valuestr)

◆ BindDegree()

bool Leviathan::BindDegree ( asIScriptEngine *  engine)

Definition at line 999 of file TypesBind.cpp.

1000 {
1001  if(engine->RegisterObjectType("Degree", sizeof(Degree),
1002  asOBJ_VALUE | asGetTypeTraits<Degree>() | asOBJ_APP_CLASS_ALLFLOATS) < 0) {
1004  }
1005  if(engine->RegisterObjectBehaviour("Degree", asBEHAVE_CONSTRUCT, "void f()",
1006  asFUNCTION(DegreeConstructorProxy), asCALL_CDECL_OBJFIRST) < 0) {
1008  }
1009 
1010  if(engine->RegisterObjectBehaviour("Degree", asBEHAVE_CONSTRUCT, "void f(float degrees)",
1011  asFUNCTION(DegreeConstructorValueProxy), asCALL_CDECL_OBJFIRST) < 0) {
1013  }
1014 
1015  if(engine->RegisterObjectBehaviour("Degree", asBEHAVE_CONSTRUCT,
1016  "void f(const Degree &in other)", asFUNCTION(DegreeConstructorCopyProxy),
1017  asCALL_CDECL_OBJFIRST) < 0) {
1019  }
1020 
1021  if(engine->RegisterObjectBehaviour("Degree", asBEHAVE_DESTRUCT, "void f()",
1022  asFUNCTION(DegreeDestructorProxy), asCALL_CDECL_OBJFIRST) < 0) {
1024  }
1025 
1026  if(engine->RegisterObjectMethod("Degree", "Degree& opAssign(const Degree &in other)",
1027  asMETHODPR(Degree, operator=,(const Degree&), Degree&), asCALL_THISCALL) < 0) {
1029  }
1030 
1031  if(engine->RegisterObjectMethod("Degree", "float ValueInRadians() const",
1032  asMETHOD(Degree, ValueInRadians), asCALL_THISCALL) < 0) {
1034  }
1035 
1036  if(engine->RegisterObjectMethod("Degree", "float ValueInDegrees() const",
1037  asMETHOD(Degree, ValueInDegrees), asCALL_THISCALL) < 0) {
1039  }
1040 
1041  // ------------------------------------ //
1042  // Bind things needing both degree and radian
1043  if(engine->RegisterObjectBehaviour("Radian", asBEHAVE_CONSTRUCT,
1044  "void f(const Degree &in degrees)", asFUNCTION(RadianConstructorDegreeProxy),
1045  asCALL_CDECL_OBJFIRST) < 0) {
1047  }
1048 
1049  if(engine->RegisterObjectBehaviour("Degree", asBEHAVE_CONSTRUCT,
1050  "void f(const Degree &in degrees)", asFUNCTION(DegreeConstructorRadianProxy),
1051  asCALL_CDECL_OBJFIRST) < 0) {
1053  }
1054 
1055  if(engine->RegisterObjectMethod("Radian", "Radian& opAssign(const Degree &in degrees)",
1056  asMETHODPR(Radian, operator=,(const Degree&), Radian&), asCALL_THISCALL) < 0) {
1058  }
1059 
1060  if(engine->RegisterObjectMethod("Degree", "Degree& opAssign(const Radian &in radians)",
1061  asMETHODPR(Degree, operator=,(const Radian&), Degree&), asCALL_THISCALL) < 0) {
1063  }
1064 
1065 
1066  if(engine->RegisterObjectMethod("Degree", "Radian opImplCast() const",
1067  asMETHODPR(Degree, operator Radian,() const, Radian), asCALL_THISCALL) < 0) {
1069  }
1070 
1071  if(engine->RegisterObjectMethod("Radian", "Degree opImplCast() const",
1072  asMETHODPR(Radian, operator Degree,() const, Degree), asCALL_THISCALL) < 0) {
1074  }
1075 
1076  return true;
1077 }
void DegreeConstructorProxy(void *memory)
Definition: TypesBind.cpp:218
void DegreeConstructorRadianProxy(void *memory, const Radian &radians)
Definition: TypesBind.cpp:233
void RadianConstructorDegreeProxy(void *memory, const Degree &degrees)
Definition: TypesBind.cpp:207
void DegreeConstructorValueProxy(void *memory, float value)
Definition: TypesBind.cpp:223
Represents an angle in radians.
Definition: Types.h:129
void DegreeDestructorProxy(void *memory)
Definition: TypesBind.cpp:238
Represents an angle in degrees.
Definition: Types.h:174
#define ANGELSCRIPT_REGISTERFAIL
Definition: BindHelpers.h:12
void DegreeConstructorCopyProxy(void *memory, const Degree &other)
Definition: TypesBind.cpp:228

◆ BindDelegates()

bool Leviathan::BindDelegates ( asIScriptEngine *  engine)

Definition at line 753 of file CommonEngineBind.cpp.

754 {
755 
756  if(engine->RegisterFuncdef("void DelegateCallbackFunc(NamedVars@ values)") < 0) {
758  }
759 
761 
762  if(engine->RegisterObjectMethod("Delegate", "void Call(NamedVars@ values) const",
763  asMETHODPR(Delegate, Call, (NamedVars*)const, void), asCALL_THISCALL) < 0) {
765  }
766 
767  if(engine->RegisterObjectMethod("Delegate",
768  "void Register(DelegateCallbackFunc@ callback)", asFUNCTION(DelegateRegisterProxy),
769  asCALL_CDECL_OBJFIRST) < 0) {
771  }
772 
773 
774  return true;
775 }
#define ANGELSCRIPT_REGISTER_REF_TYPE(RegisterName, ClassName)
Definition: BindHelpers.h:92
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:12
static void DelegateRegisterProxy(Delegate *obj, asIScriptFunction *callback)

◆ BindEngine()

bool Leviathan::BindEngine ( asIScriptEngine *  engine)

Definition at line 606 of file CommonEngineBind.cpp.

607 {
608  if(engine->RegisterObjectType("Engine", 0, asOBJ_REF | asOBJ_NOHANDLE) < 0) {
610  }
611 
612  // Global get function //
613  if(engine->RegisterGlobalFunction(
614  "Engine& GetEngine()", asFUNCTION(Engine::Get), asCALL_CDECL) < 0) {
616  }
617 
618  // Engine owned singletons //
619  if(!BindRandom(engine))
620  return false;
621 
622  if(engine->RegisterObjectMethod("Engine", "Random& GetRandom()",
623  asMETHOD(Engine, GetRandom), asCALL_THISCALL) < 0) {
625  }
626 
627  if(engine->RegisterObjectMethod("Engine", "EventHandler& GetEventHandler()",
628  asMETHOD(Engine, GetEventHandler), asCALL_THISCALL) < 0) {
630  }
631 
632  if(engine->RegisterObjectMethod("Engine", "SoundDevice& GetSoundDevice()",
633  asMETHOD(Engine, GetSoundDevice), asCALL_THISCALL) < 0) {
635  }
636 
637  if(engine->RegisterObjectMethod("Engine", "FileSystem& GetFileSystem()",
638  asMETHOD(Engine, GetFileSystem), asCALL_THISCALL) < 0) {
640  }
641 
642  if(engine->RegisterObjectMethod("Engine", "ThreadingManager& GetThreadingManager()",
643  asMETHOD(Engine, GetThreadingManager), asCALL_THISCALL) < 0) {
645  }
646 
647  if(engine->RegisterObjectMethod("Engine", "Window& GetWindowEntity()",
648  asMETHOD(Engine, GetWindowEntity), asCALL_THISCALL) < 0) {
650  }
651 
652  if(engine->RegisterObjectMethod("Engine", "Graphics& GetGraphics()",
653  asMETHOD(Engine, GetGraphics), asCALL_THISCALL) < 0) {
655  }
656 
657  // ------------------------------------ //
658 
659  if(engine->RegisterObjectMethod("Engine", "int64 GetTimeSinceLastTick()",
660  asMETHOD(Engine, GetTimeSinceLastTick), asCALL_THISCALL) < 0) {
662  }
663 
664  // TODO: restore once confirmed nothing is misusing this
665  // if(engine->RegisterObjectMethod("Engine", "int GetCurrentTick()",
666  // asMETHOD(Engine, GetCurrentTick), asCALL_THISCALL) < 0) {
667  // ANGELSCRIPT_REGISTERFAIL;
668  // }
669 
670  if(engine->RegisterObjectMethod("Engine", "int GetWindowOpenCount()",
671  asMETHOD(Engine, GetWindowOpenCount), asCALL_THISCALL) < 0) {
673  }
674 
675  if(engine->RegisterObjectMethod(
676  "Engine", "void MarkQuit()", asMETHOD(Engine, MarkQuit), asCALL_THISCALL) < 0) {
678  }
679 
680  if(engine->RegisterObjectMethod("Engine", "bool IsOnMainThread()",
681  asMETHOD(Engine, IsOnMainThread), asCALL_THISCALL) < 0) {
683  }
684 
685  if(engine->RegisterFuncdef("void InvokeCallbackFunc()") < 0) {
687  }
688 
689  if(engine->RegisterObjectMethod("Engine", "void Invoke(InvokeCallbackFunc@ callback)",
690  asFUNCTION(InvokeProxy), asCALL_CDECL_OBJFIRST) < 0) {
692  }
693 
694  return true;
695 }
The main class of the Leviathan Game Engine.
Definition: Engine.h:37
bool BindRandom(asIScriptEngine *engine)
static void InvokeProxy(Engine *obj, asIScriptFunction *callback)
#define ANGELSCRIPT_REGISTERFAIL
Definition: BindHelpers.h:12

◆ BindEngineCommon()

bool Leviathan::BindEngineCommon ( asIScriptEngine *  engine)

Definition at line 897 of file CommonEngineBind.cpp.

898 {
899  if(!BindNamedVars(engine))
900  return false;
901 
902  if(!BindEvents(engine))
903  return false;
904 
905  if(!BindSound(engine))
906  return false;
907 
908  if(!BindFileSystem(engine))
909  return false;
910 
911  if(!BindGraphics(engine))
912  return false;
913 
914  if(!BindThreadingManager(engine))
915  return false;
916 
917  if(!BindWindow(engine))
918  return false;
919 
920  if(!BindEngine(engine))
921  return false;
922 
923  if(!BindApplication(engine))
924  return false;
925 
926  if(!BindGameModule(engine))
927  return false;
928 
929  if(!BindDelegates(engine))
930  return false;
931 
932 
933  // ------------------ Global functions ------------------ //
934  if(engine->RegisterGlobalFunction("string GetLeviathanVersion()",
935  asFUNCTION(GetLeviathanVersionProxy), asCALL_CDECL) < 0) {
937  }
938 
939  if(engine->RegisterGlobalFunction("void LOG_WRITE(const string &in message)",
940  asFUNCTION(LOG_WRITEProxy), asCALL_CDECL) < 0) {
942  }
943 
944  if(engine->RegisterGlobalFunction("void LOG_INFO(const string &in message)",
945  asFUNCTION(LOG_INFOProxy), asCALL_CDECL) < 0) {
947  }
948 
949  if(engine->RegisterGlobalFunction("void LOG_WARNING(const string &in message)",
950  asFUNCTION(LOG_WARNINGProxy), asCALL_CDECL) < 0) {
952  }
953 
954  if(engine->RegisterGlobalFunction("void LOG_ERROR(const string &in message)",
955  asFUNCTION(LOG_ERRORProxy), asCALL_CDECL) < 0) {
957  }
958  // LOG_FATAL not bound
959  // Use assert instead
960 
961  if(engine->RegisterGlobalFunction("void Print(const string &in message)",
962  asFUNCTION(Logger::Print), asCALL_CDECL) < 0) {
964  }
965 
966  if(engine->RegisterGlobalFunction("void assert(bool expression, const string &in message)",
967  asFUNCTION(AngelScriptAssertWrapper), asCALL_GENERIC) < 0) {
969  }
970  if(engine->RegisterGlobalFunction("void assert(bool expression)",
971  asFUNCTION(AngelScriptAssertWrapper), asCALL_GENERIC) < 0) {
973  }
974 
975  if(engine->RegisterGlobalFunction(
976  "bool IsInGraphicalMode()", asFUNCTION(IsInGraphicalMode), asCALL_CDECL) < 0) {
978  }
979 
980  if(engine->RegisterGlobalFunction(
981  "void PrintCallStack()", asFUNCTION(PrintASCallStack), asCALL_CDECL) < 0) {
983  }
984 
985  // ------------------------------------ //
986  // Global vars
987  if(engine->RegisterGlobalProperty("const float PI", &PIProxy) < 0) {
988 
990  }
991 
992  if(engine->RegisterGlobalProperty("const float EPSILON", &EPSILONProxy) < 0) {
993 
995  }
996 
997  if(engine->RegisterGlobalProperty(
998  "const float DEGREES_TO_RADIANS", &DEGREES_TO_RADIANSProxy) < 0) {
999 
1001  }
1002 
1003  if(engine->RegisterGlobalProperty(
1004  "const float RADIANS_TO_DEGREES", &RADIANS_TO_DEGREESProxy) < 0) {
1005 
1007  }
1008 
1009  // if(engine->RegisterGlobalProperty("const int TICKSPEED", &TICKSPEEDProxy) < 0) {
1010 
1011  // ANGELSCRIPT_REGISTERFAIL;
1012  // }
1013 
1014  return true;
1015 }
bool BindEngine(asIScriptEngine *engine)
bool BindEvents(asIScriptEngine *engine)
static std::string GetLeviathanVersionProxy()
void PrintASCallStack()
Prints current angelscript callstack.
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)
bool BindGraphics(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:12
static float DEGREES_TO_RADIANSProxy
bool BindSound(asIScriptEngine *engine)

◆ BindEntity()

bool Leviathan::BindEntity ( asIScriptEngine *  engine)

Definition at line 565 of file EntityBind.cpp.

566 {
567 
568  // TODO: add reference counting for GameWorld
569  if(engine->RegisterObjectType("GameWorld", 0, asOBJ_REF | asOBJ_NOCOUNT) < 0) {
571  }
572 
573  if(!BindScriptComponentTypeSupport(engine))
574  return false;
575 
576  if(!BindRayCast(engine))
577  return false;
578 
579  if(!BindComponentTypes(engine))
580  return false;
581 
582  if(!BindGameWorldBaseMethods<GameWorld>(engine, "GameWorld"))
583  return false;
584 
585  // Component get functions //
586  // GameWorld
587 
588  // ------------------------------------ //
589  if(engine->RegisterObjectType("StandardWorld", 0, asOBJ_REF | asOBJ_NOCOUNT) < 0) {
591  }
592 
593  if(!BindStandardWorldMethods<StandardWorld>(engine, "StandardWorld"))
594  return false;
595 
596  // ------------------------------------ //
597 
598  return true;
599 }
bool BindScriptComponentTypeSupport(asIScriptEngine *engine)
Definition: EntityBind.cpp:442
bool BindRayCast(asIScriptEngine *engine)
Definition: EntityBind.cpp:96
bool BindComponentTypes(asIScriptEngine *engine)
Definition: EntityBind.cpp:148
#define ANGELSCRIPT_REGISTERFAIL
Definition: BindHelpers.h:12

◆ BindEvents()

bool Leviathan::BindEvents ( asIScriptEngine *  engine)

Definition at line 381 of file CommonEngineBind.cpp.

382 {
383  // Bind event type enum //
384  if(engine->RegisterEnum("EVENT_TYPE") < 0) {
386  }
387 
392 
393  // bind event //
395 
396  if(engine->RegisterObjectBehaviour("Event", asBEHAVE_FACTORY, "Event@ f(EVENT_TYPE type)",
397  asFUNCTION(WrapperEventFactory), asCALL_CDECL) < 0) {
399  }
400 
401  // bind generic event //
403 
404  // Factory //
405  if(engine->RegisterObjectBehaviour("GenericEvent", asBEHAVE_FACTORY,
406  "GenericEvent@ f(const string &in typename)",
407  asFUNCTION(WrapperGenericEventFactory), asCALL_CDECL) < 0) {
409  }
410 
411  // Data get function //
412  if(engine->RegisterObjectMethod("GenericEvent", "NamedVars@ GetNamedVars()",
413  asMETHOD(GenericEvent, GetNamedVarsRefCounted), asCALL_THISCALL) < 0) {
415  }
416 
417  if(engine->RegisterObjectMethod("GenericEvent", "string GetType() const",
418  asMETHOD(GenericEvent, GetType), asCALL_THISCALL) < 0) {
420  }
421 
422  // Event handler which cannot be instantiated or copied around //
423  if(engine->RegisterObjectType("EventHandler", 0, asOBJ_REF | asOBJ_NOHANDLE) < 0) {
425  }
426 
427  // Script event firing //
428  if(engine->RegisterObjectMethod("EventHandler", "void CallEvent(GenericEvent@ event)",
429  asMETHODPR(EventHandler, CallEvent, (GenericEvent*), void), asCALL_THISCALL) < 0) {
431  }
432 
433  // Event listener //
435 
436  if(engine->RegisterFuncdef("int OnEventCallback(Event@ event)") < 0) {
438  }
439 
440  if(engine->RegisterFuncdef("int OnGenericEventCallback(GenericEvent@ event)") < 0) {
442  }
443 
444  if(engine->RegisterObjectBehaviour("EventListener", asBEHAVE_FACTORY,
445  "EventListener@ f(OnEventCallback@ onevent, OnGenericEventCallback@ ongeneric)",
446  asFUNCTION(Script::EventListenerFactory), asCALL_CDECL) < 0) {
448  }
449 
450  if(engine->RegisterObjectMethod("EventListener", "bool RegisterForEvent(EVENT_TYPE type)",
451  asMETHOD(Script::EventListener, RegisterForEventType), asCALL_THISCALL) < 0) {
453  }
454 
455  if(engine->RegisterObjectMethod("EventListener",
456  "bool RegisterForEvent(const string &in name)",
457  asMETHOD(Script::EventListener, RegisterForEventGeneric), asCALL_THISCALL) < 0) {
459  }
460 
461 
462  return true;
463 }
Class that represents a statically defined event.
Definition: Event.h:106
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:92
EVENT_TYPE
Engine events that are triggered at certain times.
Definition: Event.h:12
#define ANGELSCRIPT_REGISTER_ENUM_VALUE(enum, x)
Definition: BindHelpers.h:107
Class that represents a dynamically defined event.
Definition: Event.h:140
EventListener * EventListenerFactory(asIScriptFunction *onevent, asIScriptFunction *ongeneric)
Event * WrapperEventFactory(EVENT_TYPE type)
GenericEvent * WrapperGenericEventFactory(const std::string &name)
#define ANGELSCRIPT_REGISTERFAIL
Definition: BindHelpers.h:12
An EventListener that scripts can use to listen for events.

◆ BindFileSystem()

bool Leviathan::BindFileSystem ( asIScriptEngine *  engine)

Definition at line 840 of file CommonEngineBind.cpp.

841 {
842  // Many of the filesystem methods aren't safe to expose to every
843  // script so they are hidden by default
844  if(engine->RegisterEnum("FILEGROUP") < 0) {
846  }
847 
853 
854  if(engine->RegisterObjectType("FileSystem", 0, asOBJ_REF | asOBJ_NOHANDLE) < 0) {
856  }
857 
858  const auto oldMask =
859  engine->SetDefaultAccessMask(static_cast<AccessFlags>(ScriptAccess::FullFileSystem));
860 
861  if(engine->RegisterObjectMethod("FileSystem",
862  "string SearchForFile(FILEGROUP which, const string &in name, const string &in "
863  "extensions, bool searchall = true)",
864  asMETHOD(FileSystem, SearchForFile), asCALL_THISCALL) < 0) {
866  }
867 
868  // Restore access for non-full access requiring static stuff
869  engine->SetDefaultAccessMask(oldMask);
870 
871  // ------------------------------------ //
872  // Static methods
873  if(engine->SetDefaultNamespace("FileSystem") < 0) {
875  }
876 
877  // And back to protected functions
878  engine->SetDefaultAccessMask(static_cast<AccessFlags>(ScriptAccess::FullFileSystem));
879 
880  if(engine->RegisterGlobalFunction("bool FileExists(const string &in filepath)",
881  asFUNCTION(FileSystem::FileExists), asCALL_CDECL) < 0) {
882 
884  }
885 
886  // Restore settings //
887  engine->SetDefaultAccessMask(oldMask);
888  if(engine->SetDefaultNamespace("") < 0) {
890  }
891 
892  return true;
893 }
Class for indexing and searching game data directory.
Definition: FileSystem.h:65
#define ANGELSCRIPT_REGISTER_ENUM_VALUE(enum, x)
Definition: BindHelpers.h:107
#define ANGELSCRIPT_REGISTERFAIL
Definition: BindHelpers.h:12

◆ BindFloat2()

bool Leviathan::BindFloat2 ( asIScriptEngine *  engine)

Definition at line 285 of file TypesBind.cpp.

286 {
287  if(engine->RegisterObjectType("Float2", sizeof(Float2),
288  asOBJ_VALUE | asGetTypeTraits<Float2>() | asOBJ_APP_CLASS_ALLFLOATS) < 0) {
290  }
291  if(engine->RegisterObjectBehaviour("Float2", asBEHAVE_CONSTRUCT, "void f()",
292  asFUNCTION(Float2ConstructorProxy), asCALL_CDECL_OBJFIRST) < 0) {
294  }
295  if(engine->RegisterObjectBehaviour("Float2", asBEHAVE_CONSTRUCT, "void f(float value)",
296  asFUNCTION(Float2ConstructorProxySingle), asCALL_CDECL_OBJFIRST) < 0) {
298  }
299  if(engine->RegisterObjectBehaviour("Float2", asBEHAVE_CONSTRUCT,
300  "void f(float x, float y)", asFUNCTION(Float2ConstructorProxyAll),
301  asCALL_CDECL_OBJFIRST) < 0) {
303  }
304  if(engine->RegisterObjectBehaviour("Float2", asBEHAVE_CONSTRUCT,
305  "void f(const Float2 &in other)", asFUNCTION(Float2ConstructorProxyCopy),
306  asCALL_CDECL_OBJFIRST) < 0) {
308  }
309  if(engine->RegisterObjectBehaviour("Float2", asBEHAVE_DESTRUCT, "void f()",
310  asFUNCTION(Float2DestructorProxy), asCALL_CDECL_OBJFIRST) < 0) {
312  }
313  // Operators //
314  if(engine->RegisterObjectMethod("Float2", "Float2& opAssign(const Float2 &in other)",
315  asMETHODPR(Float2, operator=,(const Float2&), Float2&), asCALL_THISCALL) < 0) {
317  }
318 
319  if(engine->RegisterObjectMethod("Float2", "Float2 opAdd(const Float2 &in other) const",
320  asMETHODPR(Float2, operator+,(const Float2&) const, Float2), asCALL_THISCALL) < 0) {
322  }
323 
324  if(engine->RegisterObjectMethod("Float2", "Float2 opSub(const Float2 &in other) const",
325  asMETHODPR(Float2, operator-,(const Float2&) const, Float2), asCALL_THISCALL) < 0) {
327  }
328 
329  if(engine->RegisterObjectMethod("Float2", "Float2 opMul(float multiply) const",
330  asMETHODPR(Float2, operator*,(float) const, Float2), asCALL_THISCALL) < 0) {
332  }
333 
334  if(engine->RegisterObjectMethod("Float2", "Float2 Normalize() const",
335  asMETHOD(Float2, Normalize), asCALL_THISCALL) < 0) {
337  }
338 
339  if(engine->RegisterObjectMethod(
340  "Float2", "float HAddAbs()", asMETHOD(Float2, HAddAbs), asCALL_THISCALL) < 0) {
342  }
343 
344  if(engine->RegisterObjectMethod("Float2", "bool HasInvalidValues() const",
345  asMETHOD(Float2, HasInvalidValues), asCALL_THISCALL) < 0) {
347  }
348 
349  // Direct access
350  if(engine->RegisterObjectProperty("Float2", "float X", asOFFSET(Float2, X)) < 0) {
351 
353  }
354 
355  if(engine->RegisterObjectProperty("Float2", "float Y", asOFFSET(Float2, Y)) < 0) {
356 
358  }
359 
360  return true;
361 }
void Float2ConstructorProxyAll(void *memory, float x, float y)
Definition: TypesBind.cpp:26
void Float2ConstructorProxy(void *memory)
Definition: TypesBind.cpp:21
void Float2ConstructorProxyCopy(void *memory, const Float2 &other)
Definition: TypesBind.cpp:36
#define ANGELSCRIPT_REGISTERFAIL
Definition: BindHelpers.h:12
void Float2DestructorProxy(void *memory)
Definition: TypesBind.cpp:41
void Float2ConstructorProxySingle(void *memory, float all)
Definition: TypesBind.cpp:31

◆ BindFloat3()

bool Leviathan::BindFloat3 ( asIScriptEngine *  engine)

Definition at line 363 of file TypesBind.cpp.

364 {
365  if(engine->RegisterObjectType("Float3", sizeof(Float3),
366  asOBJ_VALUE | asGetTypeTraits<Float3>() | asOBJ_APP_CLASS_ALLFLOATS) < 0) {
368  }
369  if(engine->RegisterObjectBehaviour("Float3", asBEHAVE_CONSTRUCT, "void f()",
370  asFUNCTION(Float3ConstructorProxy), asCALL_CDECL_OBJFIRST) < 0) {
372  }
373  if(engine->RegisterObjectBehaviour("Float3", asBEHAVE_CONSTRUCT, "void f(float value)",
374  asFUNCTION(Float3ConstructorProxySingle), asCALL_CDECL_OBJFIRST) < 0) {
376  }
377  if(engine->RegisterObjectBehaviour("Float3", asBEHAVE_CONSTRUCT,
378  "void f(float x, float y, float z)", asFUNCTION(Float3ConstructorProxyAll),
379  asCALL_CDECL_OBJFIRST) < 0) {
381  }
382  if(engine->RegisterObjectBehaviour("Float3", asBEHAVE_CONSTRUCT,
383  "void f(const Float3 &in other)", asFUNCTION(Float3ConstructorProxyCopy),
384  asCALL_CDECL_OBJFIRST) < 0) {
386  }
387  if(engine->RegisterObjectBehaviour("Float3", asBEHAVE_CONSTRUCT,
388  "void f(const Int3 &in values)", asFUNCTION(Float3ConstructorProxyFromInt3),
389  asCALL_CDECL_OBJFIRST) < 0) {
391  }
392 
393  if(engine->RegisterObjectBehaviour("Float3", asBEHAVE_DESTRUCT, "void f()",
394  asFUNCTION(Float3DestructorProxy), asCALL_CDECL_OBJFIRST) < 0) {
396  }
397  // Operators //
398  if(engine->RegisterObjectMethod("Float3", "Float3& opAssign(const Float3 &in other)",
399  asMETHODPR(Float3, operator=,(const Float3&), Float3&), asCALL_THISCALL) < 0) {
401  }
402 
403  if(engine->RegisterObjectMethod("Float3", "Float3 opAdd(const Float3 &in other) const",
404  asMETHODPR(Float3, operator+,(const Float3&) const, Float3), asCALL_THISCALL) < 0) {
406  }
407 
408  if(engine->RegisterObjectMethod("Float3", "Float3 opNeg() const",
409  asMETHODPR(Float3, operator-,() const, Float3), asCALL_THISCALL) < 0) {
411  }
412 
413  if(engine->RegisterObjectMethod("Float3", "bool opEquals(const Float3 &in other) const",
414  asMETHODPR(Float3, operator==,(const Float3&) const, bool), asCALL_THISCALL) < 0) {
416  }
417 
418  if(engine->RegisterObjectMethod("Float3", "Float3& opAddAssign(const Float3 &in other)",
419  asMETHODPR(Float3, operator+=,(const Float3&), Float3&), asCALL_THISCALL) < 0) {
421  }
422 
423  if(engine->RegisterObjectMethod("Float3", "Float3& opSubAssign(const Float3 &in other)",
424  asMETHODPR(Float3, operator-=,(const Float3&), Float3&), asCALL_THISCALL) < 0) {
426  }
427 
428  if(engine->RegisterObjectMethod("Float3", "Float3& opMulAssign(float value)",
429  asMETHODPR(Float3, operator*=,(float), Float3&), asCALL_THISCALL) < 0) {
431  }
432 
433  if(engine->RegisterObjectMethod("Float3", "Float3 opSub(const Float3 &in other) const",
434  asMETHODPR(Float3, operator-,(const Float3&) const, Float3), asCALL_THISCALL) < 0) {
436  }
437 
438  if(engine->RegisterObjectMethod("Float3", "Float3 opMul(float multiply) const",
439  asMETHODPR(Float3, operator*,(float) const, Float3), asCALL_THISCALL) < 0) {
441  }
442 
443  if(engine->RegisterObjectMethod("Float3", "Float3 opMul(const Float3 &in other) const",
444  asMETHODPR(Float3, operator*,(const Float3&) const, Float3), asCALL_THISCALL) < 0) {
446  }
447 
448  if(engine->RegisterObjectMethod("Float3", "Float3& opDivAssign(float value)",
449  asMETHODPR(Float3, operator/=,(float), Float3&), asCALL_THISCALL) < 0) {
451  }
452 
453 
454  if(engine->RegisterObjectMethod("Float3", "Float3 Normalize() const",
455  asMETHOD(Float3, Normalize), asCALL_THISCALL) < 0) {
457  }
458 
459  if(engine->RegisterObjectMethod("Float3", "float HAddAbs() const",
460  asMETHOD(Float3, HAddAbs), asCALL_THISCALL) < 0) {
462  }
463 
464  if(engine->RegisterObjectMethod(
465  "Float3", "float HAdd() const", asMETHOD(Float3, HAdd), asCALL_THISCALL) < 0) {
467  }
468 
469  if(engine->RegisterObjectMethod("Float3", "float LengthSquared() const",
470  asMETHOD(Float3, LengthSquared), asCALL_THISCALL) < 0) {
472  }
473 
474  if(engine->RegisterObjectMethod("Float3", "float Dot(const Float3 &in val) const",
475  asMETHOD(Float3, Dot), asCALL_THISCALL) < 0) {
477  }
478 
479  if(engine->RegisterObjectMethod("Float3", "Float3 Cross(const Float3 &in val) const",
480  asMETHOD(Float3, Cross), asCALL_THISCALL) < 0) {
482  }
483 
484  if(engine->RegisterObjectMethod("Float3", "bool HasInvalidValues() const",
485  asMETHOD(Float3, HasInvalidValues), asCALL_THISCALL) < 0) {
487  }
488 
489  // Direct access
490  if(engine->RegisterObjectProperty("Float3", "float X", asOFFSET(Float3, X)) < 0) {
491 
493  }
494 
495  if(engine->RegisterObjectProperty("Float3", "float Y", asOFFSET(Float3, Y)) < 0) {
496 
498  }
499 
500  if(engine->RegisterObjectProperty("Float3", "float Z", asOFFSET(Float3, Z)) < 0) {
501 
503  }
504 
505 
506  // ------------------------------------ //
507  // Named ones
508  if(engine->SetDefaultNamespace("Float3") < 0) {
510  }
511 
512  if(engine->RegisterGlobalProperty("const Float3 UnitVUp", &UnitVUpProxy) < 0) {
513 
515  }
516 
517  if(engine->SetDefaultNamespace("") < 0) {
519  }
520 
521 
522 
523  return true;
524 }
void Float3ConstructorProxy(void *memory)
Definition: TypesBind.cpp:47
void Float3ConstructorProxyFromInt3(void *memory, const Int3 &values)
Definition: TypesBind.cpp:67
void Float3ConstructorProxyAll(void *memory, float x, float y, float z)
Definition: TypesBind.cpp:52
static auto UnitVUpProxy
Definition: TypesBind.cpp:279
void Float3DestructorProxy(void *memory)
Definition: TypesBind.cpp:72
void Float3ConstructorProxySingle(void *memory, float all)
Definition: TypesBind.cpp:57
void Float3ConstructorProxyCopy(void *memory, const Float3 &other)
Definition: TypesBind.cpp:62
#define ANGELSCRIPT_REGISTERFAIL
Definition: BindHelpers.h:12

◆ BindFloat4()

bool Leviathan::BindFloat4 ( asIScriptEngine *  engine)

Definition at line 526 of file TypesBind.cpp.

527 {
528  // Float4
529  if(engine->RegisterObjectType("Float4", sizeof(Float4),
530  asOBJ_VALUE | asGetTypeTraits<Float4>() | asOBJ_APP_CLASS_ALLFLOATS) < 0) {
532  }
533 
534  if(engine->RegisterObjectBehaviour("Float4", asBEHAVE_CONSTRUCT, "void f()",
535  asFUNCTION(Float4ConstructorProxy), asCALL_CDECL_OBJFIRST) < 0) {
537  }
538 
539  if(engine->RegisterObjectBehaviour("Float4", asBEHAVE_CONSTRUCT, "void f(float value)",
540  asFUNCTION(Float4ConstructorProxySingle), asCALL_CDECL_OBJFIRST) < 0) {
542  }
543 
544  if(engine->RegisterObjectBehaviour("Float4", asBEHAVE_CONSTRUCT,
545  "void f(float x, float y, float z, float w)", asFUNCTION(Float4ConstructorProxyAll),
546  asCALL_CDECL_OBJFIRST) < 0) {
548  }
549 
550  if(engine->RegisterObjectBehaviour("Float4", asBEHAVE_CONSTRUCT,
551  "void f(const Float4 &in other)", asFUNCTION(Float4ConstructorProxyCopy),
552  asCALL_CDECL_OBJFIRST) < 0) {
554  }
555 
556  if(engine->RegisterObjectBehaviour("Float4", asBEHAVE_DESTRUCT, "void f()",
557  asFUNCTION(Float4DestructorProxy), asCALL_CDECL_OBJFIRST) < 0) {
559  }
560 
561  // Operators //
562  if(engine->RegisterObjectMethod("Float4", "Float4& opAssign(const Float4 &in other)",
563  asMETHODPR(Float4, operator=,(const Float4&), Float4&), asCALL_THISCALL) < 0) {
565  }
566 
567  if(engine->RegisterObjectMethod("Float4", "bool opEquals(const Float4 &in other) const",
568  asMETHODPR(Float4, operator==,(const Float4&) const, bool), asCALL_THISCALL) < 0) {
570  }
571 
572  if(engine->RegisterObjectMethod("Float4", "Float4 opAdd(const Float4 &in other) const",
573  asMETHODPR(Float4, operator+,(const Float4&) const, Float4), asCALL_THISCALL) < 0) {
575  }
576 
577  if(engine->RegisterObjectMethod("Float4", "Float4 opSub(const Float4 &in other) const",
578  asMETHODPR(Float4, operator-,(const Float4&) const, Float4), asCALL_THISCALL) < 0) {
580  }
581 
582  if(engine->RegisterObjectMethod("Float4", "Float4 opMul(float multiply) const",
583  asMETHODPR(Float4, operator*,(float) const, Float4), asCALL_THISCALL) < 0) {
585  }
586 
587  if(engine->RegisterObjectMethod("Float4", "Float4 opMul(const Float4 &in other) const",
588  asMETHODPR(Float4, operator*,(const Float4&) const, Float4), asCALL_THISCALL) < 0) {
590  }
591 
592  if(engine->RegisterObjectMethod("Float4", "Float4 Normalize() const",
593  asMETHOD(Float4, Normalize), asCALL_THISCALL) < 0) {
595  }
596 
597  if(engine->RegisterObjectMethod("Float4", "bool HasInvalidValues() const",
598  asMETHOD(Float4, HasInvalidValues), asCALL_THISCALL) < 0) {
600  }
601 
602  if(engine->RegisterObjectMethod("Float4",
603  "void ConvertToHSB(float &out hue, float &out saturation, float &out brightness) "
604  "const",
605  asMETHOD(Float4, ConvertToHSB), asCALL_THISCALL) < 0) {
607  }
608 
609  // Direct access
610  if(engine->RegisterObjectProperty("Float4", "float X", asOFFSET(Float4, X)) < 0) {
611 
613  }
614 
615  if(engine->RegisterObjectProperty("Float4", "float Y", asOFFSET(Float4, Y)) < 0) {
616 
618  }
619 
620  if(engine->RegisterObjectProperty("Float4", "float Z", asOFFSET(Float4, Z)) < 0) {
621 
623  }
624 
625  if(engine->RegisterObjectProperty("Float4", "float W", asOFFSET(Float4, W)) < 0) {
626 
628  }
629 
630  // ------------------------------------ //
631  // Namespace members
632  if(engine->SetDefaultNamespace("Float4") < 0) {
634  }
635 
636  if(engine->RegisterGlobalFunction(
637  "Float4 FromHSB(float hue, float saturation, float brightness)",
638  asFUNCTION(Float4::FromHSB), asCALL_CDECL) < 0) {
639 
641  }
642 
643  if(engine->SetDefaultNamespace("") < 0) {
645  }
646 
647  return true;
648 }
void Float4ConstructorProxyAll(void *memory, float x, float y, float z, float w)
Definition: TypesBind.cpp:83
void Float4ConstructorProxyCopy(void *memory, const Float4 &other)
Definition: TypesBind.cpp:93
void Float4ConstructorProxy(void *memory)
Definition: TypesBind.cpp:78
void Float4ConstructorProxySingle(void *memory, float all)
Definition: TypesBind.cpp:88
#define ANGELSCRIPT_REGISTERFAIL
Definition: BindHelpers.h:12
void Float4DestructorProxy(void *memory)
Definition: TypesBind.cpp:98

◆ BindGameModule()

bool Leviathan::BindGameModule ( asIScriptEngine *  engine)

Definition at line 738 of file CommonEngineBind.cpp.

739 {
740 
742 
743  // Bind simple name get function //
744  if(engine->RegisterObjectMethod("GameModule", "string GetDescription(bool full = false)",
745  asMETHOD(GameModule, GetDescription), asCALL_THISCALL) < 0) {
747  }
748 
749 
750  return true;
751 }
#define ANGELSCRIPT_REGISTER_REF_TYPE(RegisterName, ClassName)
Definition: BindHelpers.h:92
#define ANGELSCRIPT_REGISTERFAIL
Definition: BindHelpers.h:12
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  if(engine->RegisterObjectMethod(classname, "ObjectID CreateEntity()",
18  asMETHOD(WorldType, CreateEntity), asCALL_THISCALL) < 0) {
20  }
21 
22  // Use this rather than DestroyEntity
23  if(engine->RegisterObjectMethod(classname, "void QueueDestroyEntity(ObjectID id)",
24  asMETHOD(WorldType, QueueDestroyEntity), asCALL_THISCALL) < 0) {
26  }
27 
28  if(engine->RegisterObjectMethod(classname, "bool DestroyEntity(ObjectID id)",
29  asMETHOD(WorldType, DestroyEntity), asCALL_THISCALL) < 0) {
31  }
32 
33  if(engine->RegisterObjectMethod(classname,
34  "void SetEntitysParent(ObjectID child, ObjectID parent)",
35  asMETHOD(WorldType, SetEntitysParent), asCALL_THISCALL) < 0) {
37  }
38 
39  if(engine->RegisterObjectMethod(classname, "PhysicalWorld@ GetPhysicalWorld()",
40  asMETHOD(WorldType, GetPhysicalWorld), asCALL_THISCALL) < 0) {
42  }
43 
44  if(engine->RegisterObjectMethod(classname,
45  "int GetPhysicalMaterial(const string &in name)",
46  asMETHOD(WorldType, GetPhysicalMaterial), asCALL_THISCALL) < 0) {
48  }
49 
50  // if(engine->RegisterObjectMethod(classname,
51  // "RayCastHitEntity@ CastRayGetFirstHit(Float3 start, Float3 end)",
52  // asMETHOD(WorldType, CastRayGetFirstHitProxy), asCALL_THISCALL) < 0) {
53  // ANGELSCRIPT_REGISTERFAIL;
54  // }
55 
56  if(engine->RegisterObjectMethod(classname, "Ray CastRayFromCamera(float x, float y) const",
57  asMETHOD(WorldType, CastRayFromCamera), asCALL_THISCALL) < 0) {
59  }
60 
61  // ------------------------------------ //
62  // Support for script types
63  if(engine->RegisterObjectMethod(classname,
64  "array<ObjectID>@ GetRemovedIDsForComponents(array<uint16>@ componenttypes)",
65  asMETHOD(WorldType, GetRemovedIDsForComponents), asCALL_THISCALL) < 0) {
67  }
68 
69  if(engine->RegisterObjectMethod(classname,
70  "array<ObjectID>@ GetRemovedIDsForScriptComponents(array<string>@ typenames)",
71  asMETHOD(WorldType, GetRemovedIDsForScriptComponents), asCALL_THISCALL) < 0) {
73  }
74 
75  if(engine->RegisterObjectMethod(classname,
76  "bool RegisterScriptComponentType(const string &in name, ComponentFactoryFunc@ "
77  "factory)",
78  asMETHOD(WorldType, RegisterScriptComponentType), asCALL_THISCALL) < 0) {
80  }
81 
82  if(engine->RegisterObjectMethod(classname,
83  "bool RegisterScriptSystem(const string &in name, ScriptSystem@ systemobject)",
84  asMETHOD(WorldType, RegisterScriptSystem), asCALL_THISCALL) < 0) {
86  }
87 
88  if(engine->RegisterObjectMethod(classname,
89  "bool UnregisterScriptSystem(const string &in name)",
90  asMETHOD(WorldType, UnregisterScriptSystem), asCALL_THISCALL) < 0) {
92  }
93 
94  if(engine->RegisterObjectMethod(classname,
95  "ScriptComponentHolder@ GetScriptComponentHolder(const string &in name)",
96  asMETHOD(WorldType, GetScriptComponentHolder), asCALL_THISCALL) < 0) {
98  }
99 
100  if(engine->RegisterObjectMethod(classname,
101  "ScriptSystem@ GetScriptSystem(const string &in name)",
102  asMETHOD(WorldType, GetScriptSystem), asCALL_THISCALL) < 0) {
104  }
105 
106  // ------------------------------------ //
107  if(engine->RegisterObjectMethod(classname, "Scene@ GetScene()",
108  asMETHOD(WorldType, GetSceneWrapper), asCALL_THISCALL) < 0) {
110  }
111 
112  // if(engine->RegisterObjectMethod(classname, "bs::HSceneObject GetRootSceneObject()",
113  // asMETHOD(WorldType, GetRootSceneObject), asCALL_THISCALL) < 0) {
114  // ANGELSCRIPT_REGISTERFAIL;
115  // }
116 
117  // ------------------------------------ //
118  // Somewhat questionable Ogre shortcuts that should probably be component types
119  if(engine->RegisterObjectMethod(classname, "void SetSunlight()",
120  asMETHOD(WorldType, SetSunlight), asCALL_THISCALL) < 0) {
122  }
123 
124  if(engine->RegisterObjectMethod(classname, "void RemoveSunlight()",
125  asMETHOD(WorldType, RemoveSunlight), asCALL_THISCALL) < 0) {
127  }
128 
129  // if(engine->RegisterObjectMethod(classname,
130  // "void SetLightProperties(const Ogre::ColourValue &in diffuse, const "
131  // "Ogre::ColourValue &in specular, const Ogre::Vector3 &in direction, float power,
132  // " "const Ogre::ColourValue &in upperhemisphere, const Ogre::ColourValue &in "
133  // "lowerhemisphere, const Ogre::Vector3 &in hemispheredir, float envmapscale
134  // = 1.0f)", asMETHOD(WorldType, SetLightProperties), asCALL_THISCALL) < 0) {
135  // ANGELSCRIPT_REGISTERFAIL;
136  // }
137 
138  // ------------------------------------ //
139  // These are inefficient versions of the get methods, prefer the ones in derived classes
140  if(engine->RegisterObjectMethod(classname,
141  "Physics@ BaseWorldGetComponentPhysics(ObjectID id)",
142  asMETHODPR(WorldType, template GetComponent<Physics>, (ObjectID), Physics&),
143  asCALL_THISCALL) < 0) {
145  }
146 
147  if(engine->RegisterObjectMethod(classname,
148  "Position@ BaseWorldGetComponentPosition(ObjectID id)",
149  asMETHODPR(WorldType, template GetComponent<Position>, (ObjectID), Position&),
150  asCALL_THISCALL) < 0) {
152  }
153 
154  return true;
155 }
int32_t ObjectID
Definition: EntityCommon.h:11
#define ANGELSCRIPT_REGISTERFAIL
Definition: BindHelpers.h:12

◆ BindGraphics()

bool Leviathan::BindGraphics ( asIScriptEngine *  engine)

Definition at line 590 of file CommonEngineBind.cpp.

591 {
592  if(engine->RegisterObjectType("Graphics", 0, asOBJ_REF | asOBJ_NOCOUNT) < 0) {
594  }
595 
596  // Use the shader constructor taking a string instead
597  // if(engine->RegisterObjectMethod("Graphics",
598  // "bs::HShader LoadShaderByName(const string &in name)",
599  // asMETHOD(Graphics, LoadShaderByName), asCALL_THISCALL) < 0) {
600  // ANGELSCRIPT_REGISTERFAIL;
601  // }
602 
603  return true;
604 }
#define ANGELSCRIPT_REGISTERFAIL
Definition: BindHelpers.h:12

◆ 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:12

◆ BindInt2()

bool Leviathan::BindInt2 ( asIScriptEngine *  engine)

Definition at line 817 of file TypesBind.cpp.

818 {
819  if(engine->RegisterObjectType("Int2", sizeof(Int2),
820  asOBJ_VALUE | asGetTypeTraits<Int2>() | asOBJ_APP_CLASS_ALLINTS) < 0) {
822  }
823  if(engine->RegisterObjectBehaviour("Int2", asBEHAVE_CONSTRUCT, "void f()",
824  asFUNCTION(Int2ConstructorProxy), asCALL_CDECL_OBJFIRST) < 0) {
826  }
827  if(engine->RegisterObjectBehaviour("Int2", asBEHAVE_CONSTRUCT, "void f(int value)",
828  asFUNCTION(Int2ConstructorProxySingle), asCALL_CDECL_OBJFIRST) < 0) {
830  }
831  if(engine->RegisterObjectBehaviour("Int2", asBEHAVE_CONSTRUCT, "void f(int x, int y)",
832  asFUNCTION(Int2ConstructorProxyAll), asCALL_CDECL_OBJFIRST) < 0) {
834  }
835  if(engine->RegisterObjectBehaviour("Int2", asBEHAVE_CONSTRUCT,
836  "void f(const Int2 &in other)", asFUNCTION(Int2ConstructorProxyCopy),
837  asCALL_CDECL_OBJFIRST) < 0) {
839  }
840  if(engine->RegisterObjectBehaviour("Int2", asBEHAVE_DESTRUCT, "void f()",
841  asFUNCTION(Int2DestructorProxy), asCALL_CDECL_OBJFIRST) < 0) {
843  }
844 
845  if(engine->RegisterObjectBehaviour("Int2", asBEHAVE_LIST_CONSTRUCT,
846  "void f(const int &in) {int, int}", asFUNCTION(Int2ListConstructor),
847  asCALL_CDECL_OBJFIRST) < 0) {
849  }
850 
851  // Operators //
852  if(engine->RegisterObjectMethod("Int2", "Int2& opAssign(const Int2 &in other)",
853  asMETHODPR(Int2, operator=,(const Int2&), Int2&), asCALL_THISCALL) < 0) {
855  }
856 
857  if(engine->RegisterObjectMethod("Int2", "Int2 opAdd(const Int2 &in other) const",
858  asMETHODPR(Int2, operator+,(const Int2&) const, Int2), asCALL_THISCALL) < 0) {
860  }
861 
862  if(engine->RegisterObjectMethod("Int2", "Int2 opSub(const Int2 &in other) const",
863  asMETHODPR(Int2, operator-,(const Int2&) const, Int2), asCALL_THISCALL) < 0) {
865  }
866 
867  if(engine->RegisterObjectMethod("Int2", "Int2 opMul(int multiply) const",
868  asMETHODPR(Int2, operator*,(int) const, Int2), asCALL_THISCALL) < 0) {
870  }
871 
872  // Direct access
873  if(engine->RegisterObjectProperty("Int2", "int X", asOFFSET(Int2, X)) < 0) {
874 
876  }
877 
878  if(engine->RegisterObjectProperty("Int2", "int Y", asOFFSET(Int2, Y)) < 0) {
879 
881  }
882 
883  return true;
884 }
void Int2DestructorProxy(void *memory)
Definition: TypesBind.cpp:160
void Int2ConstructorProxySingle(void *memory, int all)
Definition: TypesBind.cpp:145
void Int2ConstructorProxyAll(void *memory, int x, int y)
Definition: TypesBind.cpp:140
#define ANGELSCRIPT_REGISTERFAIL
Definition: BindHelpers.h:12
void Int2ListConstructor(void *memory, int *list)
Definition: TypesBind.cpp:155
void Int2ConstructorProxy(void *memory)
Definition: TypesBind.cpp:135
void Int2ConstructorProxyCopy(void *memory, const Int2 &other)
Definition: TypesBind.cpp:150

◆ BindInt3()

bool Leviathan::BindInt3 ( asIScriptEngine *  engine)

Definition at line 886 of file TypesBind.cpp.

887 {
888  if(engine->RegisterObjectType("Int3", sizeof(Int3),
889  asOBJ_VALUE | asGetTypeTraits<Int3>() | asOBJ_APP_CLASS_ALLINTS) < 0) {
891  }
892  if(engine->RegisterObjectBehaviour("Int3", asBEHAVE_CONSTRUCT, "void f()",
893  asFUNCTION(Int3ConstructorProxy), asCALL_CDECL_OBJFIRST) < 0) {
895  }
896  if(engine->RegisterObjectBehaviour("Int3", asBEHAVE_CONSTRUCT, "void f(int value)",
897  asFUNCTION(Int3ConstructorProxySingle), asCALL_CDECL_OBJFIRST) < 0) {
899  }
900  if(engine->RegisterObjectBehaviour("Int3", asBEHAVE_CONSTRUCT,
901  "void f(int x, int y, int z)", asFUNCTION(Int3ConstructorProxyAll),
902  asCALL_CDECL_OBJFIRST) < 0) {
904  }
905  if(engine->RegisterObjectBehaviour("Int3", asBEHAVE_CONSTRUCT,
906  "void f(const Int3 &in other)", asFUNCTION(Int3ConstructorProxyCopy),
907  asCALL_CDECL_OBJFIRST) < 0) {
909  }
910  if(engine->RegisterObjectBehaviour("Int3", asBEHAVE_DESTRUCT, "void f()",
911  asFUNCTION(Int3DestructorProxy), asCALL_CDECL_OBJFIRST) < 0) {
913  }
914  // Operators //
915  if(engine->RegisterObjectMethod("Int3", "Int3& opAssign(const Int3 &in other)",
916  asMETHODPR(Int3, operator=,(const Int3&), Int3&), asCALL_THISCALL) < 0) {
918  }
919 
920  if(engine->RegisterObjectMethod("Int3", "Int3 opAdd(const Int3 &in other) const",
921  asMETHODPR(Int3, operator+,(const Int3&) const, Int3), asCALL_THISCALL) < 0) {
923  }
924 
925  if(engine->RegisterObjectMethod("Int3", "Int3 opSub(const Int3 &in other) const",
926  asMETHODPR(Int3, operator-,(const Int3&) const, Int3), asCALL_THISCALL) < 0) {
928  }
929 
930  if(engine->RegisterObjectMethod("Int3", "Int3 opMul(int multiply) const",
931  asMETHODPR(Int3, operator*,(int) const, Int3), asCALL_THISCALL) < 0) {
933  }
934 
935  // Direct access
936  if(engine->RegisterObjectProperty("Int3", "int X", asOFFSET(Int3, X)) < 0) {
937 
939  }
940 
941  if(engine->RegisterObjectProperty("Int3", "int Y", asOFFSET(Int3, Y)) < 0) {
942 
944  }
945 
946  if(engine->RegisterObjectProperty("Int3", "int Z", asOFFSET(Int3, Z)) < 0) {
947 
949  }
950 
951  return true;
952 }
void Int3ConstructorProxy(void *memory)
Definition: TypesBind.cpp:166
void Int3DestructorProxy(void *memory)
Definition: TypesBind.cpp:186
void Int3ConstructorProxyAll(void *memory, int x, int y, int z)
Definition: TypesBind.cpp:171
void Int3ConstructorProxySingle(void *memory, int all)
Definition: TypesBind.cpp:176
#define ANGELSCRIPT_REGISTERFAIL
Definition: BindHelpers.h:12
void Int3ConstructorProxyCopy(void *memory, const Int3 &other)
Definition: TypesBind.cpp:181

◆ BindMaterial()

bool Leviathan::BindMaterial ( asIScriptEngine *  engine)

Definition at line 114 of file BindRendering.cpp.

115 {
117 
118  if(engine->RegisterObjectBehaviour("Material", asBEHAVE_FACTORY,
119  "Material@ f(Shader@ shader)", asFUNCTION(MaterialFromShaderFactory),
120  asCALL_CDECL) < 0) {
122  }
123 
124  if(engine->RegisterObjectBehaviour("Material", asBEHAVE_FACTORY, "Material@ f()",
125  asFUNCTION(MaterialEmptyFactory), asCALL_CDECL) < 0) {
127  }
128 
129  if(engine->RegisterObjectMethod("Material",
130  "void SetTexture(const string &in parameter, Texture@ texture)",
131  asMETHOD(Material, SetTextureWrapper), asCALL_THISCALL) < 0) {
133  }
134 
135  if(engine->RegisterObjectMethod("Material",
136  "void SetFloat4(const string &in parameter, const Float4 &in data)",
137  asMETHOD(Material, SetFloat4), asCALL_THISCALL) < 0) {
139  }
140 
141  return true;
142 }
Material * MaterialFromShaderFactory(Shader *shader)
#define ANGELSCRIPT_REGISTER_REF_TYPE(RegisterName, ClassName)
Definition: BindHelpers.h:92
Material * MaterialEmptyFactory()
#define ANGELSCRIPT_REGISTERFAIL
Definition: BindHelpers.h:12

◆ 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  // clamp
126  if(engine->RegisterGlobalFunction("const float & clamp(const float &in value, const float "
127  "&in lower, const float &in upper)",
128  asFUNCTIONPR(
129  std::clamp<float>, (const float&, const float&, const float&), const float&),
130  asCALL_CDECL) < 0) {
131 
133  }
134 
135  // ------------------------------------ //
136  // Extra string helpers
137  if(engine->RegisterGlobalFunction("string CharacterToString(int32 character)",
138  asFUNCTION(CharacterToStringProxy), asCALL_CDECL) < 0) {
139 
141  }
142 
143 
144  return true;
145 }
float SignProxy(float value)
std::string CharacterToStringProxy(int32_t character)
int RoundProxy(double value)
int RoundProxy2(float value)
#define ANGELSCRIPT_REGISTERFAIL
Definition: BindHelpers.h:12

◆ BindMatrix4()

bool Leviathan::BindMatrix4 ( asIScriptEngine *  engine)

Definition at line 1079 of file TypesBind.cpp.

1080 {
1081  if(engine->RegisterObjectType("Matrix4", sizeof(Matrix4),
1082  asOBJ_VALUE | asGetTypeTraits<Matrix4>() | asOBJ_APP_CLASS_ALLFLOATS) < 0) {
1084  }
1085  if(engine->RegisterObjectBehaviour("Matrix4", asBEHAVE_CONSTRUCT, "void f()",
1086  asFUNCTION(Matrix4ConstructorProxy), asCALL_CDECL_OBJFIRST) < 0) {
1088  }
1089  if(engine->RegisterObjectBehaviour("Matrix4", asBEHAVE_DESTRUCT, "void f()",
1090  asFUNCTION(Matrix4DestructorProxy), asCALL_CDECL_OBJFIRST) < 0) {
1092  }
1093 
1094  return true;
1095 }
void Matrix4DestructorProxy(void *memory)
Definition: TypesBind.cpp:250
#define ANGELSCRIPT_REGISTERFAIL
Definition: BindHelpers.h:12
void Matrix4ConstructorProxy(void *memory)
Definition: TypesBind.cpp:245
A 4x4 matrix type.
Definition: Matrix.h:379

◆ BindNamedVars()

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

Definition at line 259 of file CommonEngineBind.cpp.

260 {
262 
263  if(!BindDataBlock(engine))
264  return false;
265 
266  if(engine->RegisterObjectBehaviour("NamedVars", asBEHAVE_FACTORY, "NamedVars@ f()",
267  asFUNCTION(NamedVarsFactory), asCALL_CDECL) < 0) {
269  }
270 
271  if(engine->RegisterObjectMethod("NamedVars",
272  "ScriptSafeVariableBlock@ GetSingleValueByName(const string &in name)",
273  asMETHOD(NamedVars, GetScriptCompatibleValue), asCALL_THISCALL) < 0) {
275  }
276 
277  if(engine->RegisterObjectMethod("NamedVars",
278  "bool AddValue(ScriptSafeVariableBlock@ value)",
279  asMETHOD(NamedVars, AddScriptCompatibleValue), asCALL_THISCALL) < 0) {
281  }
282 
283  if(engine->RegisterObjectMethod("NamedVars",
284  "string Serialize(const string &in lineprefix = \"\") const",
285  asMETHOD(NamedVars, Serialize), asCALL_THISCALL) < 0) {
287  }
288 
289  return true;
290 }
bool BindDataBlock(asIScriptEngine *engine)
#define ANGELSCRIPT_REGISTER_REF_TYPE(RegisterName, ClassName)
Definition: BindHelpers.h:92
#define ANGELSCRIPT_REGISTERFAIL
Definition: BindHelpers.h:12
static NamedVars * NamedVarsFactory()

◆ BindPhysics()

bool Leviathan::BindPhysics ( asIScriptEngine *  engine)

Definition at line 182 of file PhysicsBind.cpp.

183 {
184  if(!BindShape(engine))
185  return false;
186 
187  if(!BindConstraint(engine))
188  return false;
189 
190  if(!BindBody(engine))
191  return false;
192 
193  // These classes are Leviathan classes so these should not be in the newton namespace
194  if(engine->RegisterObjectType("PhysicalWorld", 0, asOBJ_REF | asOBJ_NOCOUNT) < 0) {
196  }
197 
198  if(engine->RegisterObjectMethod("PhysicalWorld", "PhysicsShape@ CreateCompound()",
199  asMETHOD(PhysicalWorld, CreateCompoundWrapper), asCALL_THISCALL) < 0) {
201  }
202 
203  if(engine->RegisterObjectMethod("PhysicalWorld",
204  "PhysicsShape@ CreateSphere(float radius)",
205  asMETHOD(PhysicalWorld, CreateSphereWrapper), asCALL_THISCALL) < 0) {
207  }
208 
209  if(engine->RegisterObjectMethod("PhysicalWorld",
210  "PhysicsShape@ CreateCone(float radius, float height)",
211  asMETHOD(PhysicalWorld, CreateConeWrapper), asCALL_THISCALL) < 0) {
213  }
214 
215  if(engine->RegisterObjectMethod("PhysicalWorld",
216  "PhysicsConstraint@ CreateFixedConstraint(PhysicsBody@ a, PhysicsBody@ b, const "
217  "Float3 &in aoffset, const Quaternion &in aorientation, const Float3 &in boffset, "
218  "const Quaternion &in borientation)",
219  asMETHOD(PhysicalWorld, CreateFixedConstraintWrapper), asCALL_THISCALL) < 0) {
221  }
222 
223  if(engine->RegisterObjectMethod("PhysicalWorld",
224  "bool DestroyConstraint(PhysicsConstraint@ constraint)",
225  asMETHOD(PhysicalWorld, DestroyConstraintWrapper), asCALL_THISCALL) < 0) {
227  }
228 
229  // ------------------------------------ //
230 
231 
232 
233  return true;
234 }
bool BindBody(asIScriptEngine *engine)
Definition: PhysicsBind.cpp:75
#define ANGELSCRIPT_REGISTERFAIL
Definition: BindHelpers.h:12
bool BindConstraint(asIScriptEngine *engine)
Definition: PhysicsBind.cpp:63
bool BindShape(asIScriptEngine *engine)
Definition: PhysicsBind.cpp:20

◆ BindPlane()

bool Leviathan::BindPlane ( asIScriptEngine *  engine)

Definition at line 1115 of file TypesBind.cpp.

1116 {
1117  if(engine->RegisterObjectType("Plane", sizeof(Plane),
1118  asOBJ_VALUE | asGetTypeTraits<Plane>() | asOBJ_APP_CLASS_ALLFLOATS) < 0) {
1120  }
1121  if(engine->RegisterObjectBehaviour("Plane", asBEHAVE_CONSTRUCT,
1122  "void f(const Float3 &in normal, float distance)",
1123  asFUNCTION(PlaneConstructorVectorProxy), asCALL_CDECL_OBJFIRST) < 0) {
1125  }
1126  if(engine->RegisterObjectBehaviour("Plane", asBEHAVE_DESTRUCT, "void f()",
1127  asFUNCTION(PlaneDestructorProxy), asCALL_CDECL_OBJFIRST) < 0) {
1129  }
1130 
1131  return true;
1132 }
void PlaneConstructorVectorProxy(void *memory, const Float3 &normal, float distance)
Definition: TypesBind.cpp:269
A plane represented by a normal and a distance.
Definition: Plane.h:12
void PlaneDestructorProxy(void *memory)
Definition: TypesBind.cpp:274
#define ANGELSCRIPT_REGISTERFAIL
Definition: BindHelpers.h:12

◆ BindQuaternion()

bool Leviathan::BindQuaternion ( asIScriptEngine *  engine)

Definition at line 650 of file TypesBind.cpp.

651 {
652  // Quaternion
653  if(engine->RegisterObjectType("Quaternion", sizeof(Quaternion),
654  asOBJ_VALUE | asGetTypeTraits<Quaternion>() | asOBJ_APP_CLASS_ALLFLOATS) < 0) {
656  }
657 
658  if(engine->RegisterObjectBehaviour("Quaternion", asBEHAVE_CONSTRUCT, "void f()",
659  asFUNCTION(QuaternionConstructorProxy), asCALL_CDECL_OBJFIRST) < 0) {
661  }
662 
663  if(engine->RegisterObjectBehaviour("Quaternion", asBEHAVE_CONSTRUCT,
664  "void f(float x, float y, float z, float w)",
665  asFUNCTION(QuaternionConstructorProxyAll), asCALL_CDECL_OBJFIRST) < 0) {
667  }
668 
669  if(engine->RegisterObjectBehaviour("Quaternion", asBEHAVE_CONSTRUCT,
670  "void f(const Quaternion &in other)", asFUNCTION(QuaternionConstructorProxyCopy),