Caster/Pointer/Pointable

This commit is contained in:
Josef 2024-08-02 08:21:30 +02:00
parent 650c34164a
commit 29c6666c18
35 changed files with 766 additions and 323 deletions

View File

@ -1,25 +0,0 @@
/* RJBoolProperty.cpp */
#include "RJBoolProperty.h"
void RJBoolProperty::_bind_methods()
{
GDVIRTUAL_BIND( set, "value" );
GDVIRTUAL_BIND( get );
ADD_SIGNAL (MethodInfo( "onChange" ) );
}
RJBoolProperty::RJBoolProperty()
{
}
RJBoolProperty::~RJBoolProperty()
{
}

View File

@ -1,33 +0,0 @@
/* RJBoolProperty.h */
#ifndef ROKOJORI__BOOL_PROPERTY_H
#define ROKOJORI__BOOL_PROPERTY_H
#include "./RJNetworkNode.h"
class RJBoolProperty : public RJNetworkNode
{
GDCLASS(RJBoolProperty, RJNetworkNode);
protected:
static void _bind_methods();
public:
GDVIRTUAL1( set, bool );
GDVIRTUAL0R( bool, get );
/* signal onChange */
RJBoolProperty();
~RJBoolProperty();
};
#endif // ROKOJORI__BOOL_PROPERTY_H

65
RJCaster.cpp Normal file
View File

@ -0,0 +1,65 @@
/* RJCaster.cpp */
#include "RJCaster.h"
// Registers fields, signals and methods for Godot
void RJCaster::_bind_methods()
{
// beforeProcess: RJAction*
ClassDB::bind_method( D_METHOD( "set_beforeProcess", "beforeProcess" ), &RJCaster::set_beforeProcess );
ClassDB::bind_method( D_METHOD( "get_beforeProcess"), &RJCaster::get_beforeProcess);
ADD_PROPERTY( PropertyInfo(Variant::OBJECT, "beforeProcess", PROPERTY_HINT_NODE_TYPE ), "set_beforeProcess", "get_beforeProcess" );
// afterProcess: RJAction*
ClassDB::bind_method( D_METHOD( "set_afterProcess", "afterProcess" ), &RJCaster::set_afterProcess );
ClassDB::bind_method( D_METHOD( "get_afterProcess"), &RJCaster::get_afterProcess);
ADD_PROPERTY( PropertyInfo(Variant::OBJECT, "afterProcess", PROPERTY_HINT_NODE_TYPE ), "set_afterProcess", "get_afterProcess" );
// includeSelector: Ref<RJSelector>
ClassDB::bind_method( D_METHOD( "set_includeSelector", "includeSelector" ), &RJCaster::set_includeSelector );
ClassDB::bind_method( D_METHOD( "get_includeSelector"), &RJCaster::get_includeSelector);
ADD_PROPERTY( PropertyInfo(Variant::OBJECT, "includeSelector", PROPERTY_HINT_RESOURCE_TYPE ), "set_includeSelector", "get_includeSelector" );
// excludeSelector: Ref<RJSelector>
ClassDB::bind_method( D_METHOD( "set_excludeSelector", "excludeSelector" ), &RJCaster::set_excludeSelector );
ClassDB::bind_method( D_METHOD( "get_excludeSelector"), &RJCaster::get_excludeSelector);
ADD_PROPERTY( PropertyInfo(Variant::OBJECT, "excludeSelector", PROPERTY_HINT_RESOURCE_TYPE ), "set_excludeSelector", "get_excludeSelector" );
GDVIRTUAL_BIND( numColliders );
GDVIRTUAL_BIND( getCollider, "index" );
GDVIRTUAL_BIND( getCollisionPosition, "index" );
GDVIRTUAL_BIND( getCollisionNormal, "index" );
GDVIRTUAL_BIND( getCollisionShape, "index" );
}
// Constructor
RJCaster::RJCaster()
{
}
// Destructor
RJCaster::~RJCaster()
{
}
// beforeProcess: RJAction*
RJAction* RJCaster::get_beforeProcess() const { return beforeProcess; }
void RJCaster::set_beforeProcess( RJAction* p_beforeProcess ) { beforeProcess = p_beforeProcess; }
// afterProcess: RJAction*
RJAction* RJCaster::get_afterProcess() const { return afterProcess; }
void RJCaster::set_afterProcess( RJAction* p_afterProcess ) { afterProcess = p_afterProcess; }
// includeSelector: Ref<RJSelector>
Ref<RJSelector> RJCaster::get_includeSelector() const { return includeSelector; }
void RJCaster::set_includeSelector( const Ref<RJSelector> &p_includeSelector ) { includeSelector = p_includeSelector; }
// excludeSelector: Ref<RJSelector>
Ref<RJSelector> RJCaster::get_excludeSelector() const { return excludeSelector; }
void RJCaster::set_excludeSelector( const Ref<RJSelector> &p_excludeSelector ) { excludeSelector = p_excludeSelector; }

76
RJCaster.h Normal file
View File

@ -0,0 +1,76 @@
/* RJCaster.h */
#ifndef ROKOJORI__CASTER_H
#define ROKOJORI__CASTER_H
#include "./RJGodotHeaders.h"
#include "./RJAction.h"
#include "./RJSelector.h"
#include "core/math/vector3.h"
#include "scene/resources/3d/shape_3d.h"
#include "scene/3d/node_3d.h"
class RJCaster : public Node3D
{
GDCLASS( RJCaster, Node3D );
protected:
static void _bind_methods();
// beforeProcess : RJAction*
RJAction* beforeProcess = nullptr;
// afterProcess : RJAction*
RJAction* afterProcess = nullptr;
// includeSelector : Ref<RJSelector>
Ref<RJSelector> includeSelector;
// excludeSelector : Ref<RJSelector>
Ref<RJSelector> excludeSelector;
public:
// beforeProcess : RJAction*
RJAction* get_beforeProcess() const; void set_beforeProcess( RJAction* p_beforeProcess );
// afterProcess : RJAction*
RJAction* get_afterProcess() const; void set_afterProcess( RJAction* p_afterProcess );
// includeSelector : Ref<RJSelector>
Ref<RJSelector> get_includeSelector() const; void set_includeSelector( const Ref<RJSelector> &p_includeSelector );
// excludeSelector : Ref<RJSelector>
Ref<RJSelector> get_excludeSelector() const; void set_excludeSelector( const Ref<RJSelector> &p_excludeSelector );
// numColliders() : int
GDVIRTUAL0R( int, numColliders );
// getCollider( int index ) : Ref<Node>
GDVIRTUAL1R( Ref<Node>, getCollider, int );
// getCollisionPosition( int index ) : Vector3
GDVIRTUAL1R( Vector3, getCollisionPosition, int );
// getCollisionNormal( int index ) : Vector3
GDVIRTUAL1R( Vector3, getCollisionNormal, int );
// getCollisionShape( int index ) : Ref<Shape3D>
GDVIRTUAL1R( Ref<Shape3D>, getCollisionShape, int );
// Constructor
RJCaster();
// Destructor
~RJCaster();
};
#endif // ROKOJORI__CASTER_H

21
RJGodotHeaders.h Normal file
View File

@ -0,0 +1,21 @@
/* RJGodotHeaders.h */
#ifndef ROKOJORI_GODOT_HEADERS_H
#define ROKOJORI_GODOT_HEADERS_H
#include "scene/main/node.h"
#include "scene/2d/node_2d.h"
#include "scene/3d/node_3d.h"
#include "core/io/resource.h"
#include "core/math/vector3.h"
#include "core/math/vector3.h"
#include "core/math/quaternion.h"
#include "core/math/color.h"
#include "./RJNetworkNode.h"
#include "./RJAction.h"
#include "./RJSequenceAction.h"
#endif // ROKOJORI_GODOT_HEADERS_H

71
RJIntProperty.cpp Normal file
View File

@ -0,0 +1,71 @@
/* RJIntProperty.cpp */
#include "RJIntProperty.h"
// Registers fields, signals and methods for Godot
void RJIntProperty::_bind_methods()
{
// value: int
ClassDB::bind_method( D_METHOD( "set_value", "value" ), &RJIntProperty::set_value );
ClassDB::bind_method( D_METHOD( "get_value"), &RJIntProperty::get_value);
ADD_PROPERTY(PropertyInfo( Variant::INT, "value" ), "set_value", "get_value" );
ADD_SIGNAL (MethodInfo( "valueChanged" ) );
// onValueChanged: RJAction*
ClassDB::bind_method( D_METHOD( "set_onValueChanged", "onValueChanged" ), &RJIntProperty::set_onValueChanged );
ClassDB::bind_method( D_METHOD( "get_onValueChanged"), &RJIntProperty::get_onValueChanged);
ADD_PROPERTY( PropertyInfo(Variant::OBJECT, "onValueChanged", PROPERTY_HINT_NODE_TYPE ), "set_onValueChanged", "get_onValueChanged" );
ClassDB::bind_method( D_METHOD( "dispatchValueChanged" ) , &RJIntProperty::dispatchValueChanged );
ClassDB::bind_method( D_METHOD( "setValueSilent" ) , &RJIntProperty::setValueSilent );
}
// Constructor
RJIntProperty::RJIntProperty()
{
}
// Destructor
RJIntProperty::~RJIntProperty()
{
}
// value: int
int RJIntProperty::get_value() { return value; }
void RJIntProperty::set_value( int p_value )
{
value = p_value;
emit_signal( SNAME( "valueChanged" ) );
if ( onValueChanged != NULL )
{
onValueChanged->trigger();
}
}
// onValueChanged: RJAction*
RJAction* RJIntProperty::get_onValueChanged() const { return onValueChanged; }
void RJIntProperty::set_onValueChanged( RJAction* p_onValueChanged ) { onValueChanged = p_onValueChanged; }
// dispatchValueChanged() : void
void RJIntProperty::dispatchValueChanged()
{
emit_signal( SNAME( "valueChanged" ) );
if ( onValueChanged != NULL )
{
onValueChanged->trigger();
}
}
// setValueSilent( int p_value ) : void
void RJIntProperty::setValueSilent( int p_value )
{
value = p_value;
}

53
RJIntProperty.h Normal file
View File

@ -0,0 +1,53 @@
/* RJIntProperty.h */
#ifndef ROKOJORI__INT_PROPERTY_H
#define ROKOJORI__INT_PROPERTY_H
#include "./RJGodotHeaders.h"
#include "scene/main/node.h"
class RJIntProperty : public Node
{
GDCLASS( RJIntProperty, Node );
protected:
static void _bind_methods();
// value : int
int value;
// onValueChanged : RJAction*
RJAction* onValueChanged = nullptr;
public:
// value : int
int get_value(); void set_value( int p_value );
// [signal] valueChanged() : void
// onValueChanged : RJAction*
RJAction* get_onValueChanged() const; void set_onValueChanged( RJAction* p_onValueChanged );
// dispatchValueChanged() : void
void dispatchValueChanged();
// setValueSilent( int p_value ) : void
void setValueSilent( int p_value );
// Constructor
RJIntProperty();
// Destructor
~RJIntProperty();
};
#endif // ROKOJORI__INT_PROPERTY_H

View File

@ -1,18 +1,26 @@
/* RJNetworkNode.cpp */
#include "RJNetworkNode.h"
// Registers fields, signals and methods for Godot
void RJNetworkNode::_bind_methods()
{
}
// Constructor
RJNetworkNode::RJNetworkNode()
{
}
// Destructor
RJNetworkNode::~RJNetworkNode()
{
}

View File

@ -1,3 +1,4 @@
/* RJNetworkNode.h */
#ifndef ROKOJORI__NETWORK_NODE_H
@ -5,7 +6,6 @@
#include "scene/main/node.h"
class RJNetworkNode : public Node
{
GDCLASS( RJNetworkNode, Node );
@ -13,9 +13,17 @@ class RJNetworkNode : public Node
protected:
static void _bind_methods();
public:
// Constructor
RJNetworkNode();
// Destructor
~RJNetworkNode();
};

View File

@ -1,25 +0,0 @@
/* RJNodeProperty.cpp */
#include "RJNodeProperty.h"
void RJNodeProperty::_bind_methods()
{
GDVIRTUAL_BIND( set, "value" );
GDVIRTUAL_BIND( get );
ADD_SIGNAL (MethodInfo( "onChange" ) );
}
RJNodeProperty::RJNodeProperty()
{
}
RJNodeProperty::~RJNodeProperty()
{
}

View File

@ -1,33 +0,0 @@
/* RJNodeProperty.h */
#ifndef ROKOJORI__NODE_PROPERTY_H
#define ROKOJORI__NODE_PROPERTY_H
#include "./RJNetworkNode.h"
class RJNodeProperty : public RJNetworkNode
{
GDCLASS(RJNodeProperty, RJNetworkNode);
protected:
static void _bind_methods();
public:
GDVIRTUAL1( set, Ref<Node> );
GDVIRTUAL0R( Ref<Node>, get );
/* signal onChange */
RJNodeProperty();
~RJNodeProperty();
};
#endif // ROKOJORI__NODE_PROPERTY_H

View File

@ -1,27 +0,0 @@
/* RJNumberProperty.cpp */
#include "RJNumberProperty.h"
void RJNumberProperty::_bind_methods()
{
GDVIRTUAL_BIND( set, "value" );
GDVIRTUAL_BIND( get );
ADD_SIGNAL (MethodInfo( "changed" ) );
GDVIRTUAL_BIND( get_onChanged );
GDVIRTUAL_BIND( set_onChanged, "action" );
}
RJNumberProperty::RJNumberProperty()
{
}
RJNumberProperty::~RJNumberProperty()
{
}

View File

@ -1,35 +0,0 @@
/* RJNumberProperty.h */
#ifndef ROKOJORI__NUMBER_PROPERTY_H
#define ROKOJORI__NUMBER_PROPERTY_H
#include "./RJAction.h"
#include "./RJNetworkNode.h"
class RJNumberProperty : public RJNetworkNode
{
GDCLASS(RJNumberProperty, RJNetworkNode);
protected:
static void _bind_methods();
public:
GDVIRTUAL1( set, double );
GDVIRTUAL0R( double, get );
/* signal changed */
GDVIRTUAL0R( Ref<RJAction>, get_onChanged );
GDVIRTUAL1( set_onChanged, Ref<RJAction> );
RJNumberProperty();
~RJNumberProperty();
};
#endif // ROKOJORI__NUMBER_PROPERTY_H

72
RJPointable.cpp Normal file
View File

@ -0,0 +1,72 @@
/* RJPointable.cpp */
#include "RJPointable.h"
// Registers fields, signals and methods for Godot
void RJPointable::_bind_methods()
{
// pointingPriority: int
ClassDB::bind_method( D_METHOD( "set_pointingPriority", "pointingPriority" ), &RJPointable::set_pointingPriority );
ClassDB::bind_method( D_METHOD( "get_pointingPriority"), &RJPointable::get_pointingPriority);
ADD_PROPERTY(PropertyInfo( Variant::INT, "pointingPriority" ), "set_pointingPriority", "get_pointingPriority" );
// onPointed: RJAction*
ClassDB::bind_method( D_METHOD( "set_onPointed", "onPointed" ), &RJPointable::set_onPointed );
ClassDB::bind_method( D_METHOD( "get_onPointed"), &RJPointable::get_onPointed);
ADD_PROPERTY( PropertyInfo(Variant::OBJECT, "onPointed", PROPERTY_HINT_NODE_TYPE ), "set_onPointed", "get_onPointed" );
// onUnpointed: RJAction*
ClassDB::bind_method( D_METHOD( "set_onUnpointed", "onUnpointed" ), &RJPointable::set_onUnpointed );
ClassDB::bind_method( D_METHOD( "get_onUnpointed"), &RJPointable::get_onUnpointed);
ADD_PROPERTY( PropertyInfo(Variant::OBJECT, "onUnpointed", PROPERTY_HINT_NODE_TYPE ), "set_onUnpointed", "get_onUnpointed" );
// onPointerAdded: RJAction*
ClassDB::bind_method( D_METHOD( "set_onPointerAdded", "onPointerAdded" ), &RJPointable::set_onPointerAdded );
ClassDB::bind_method( D_METHOD( "get_onPointerAdded"), &RJPointable::get_onPointerAdded);
ADD_PROPERTY( PropertyInfo(Variant::OBJECT, "onPointerAdded", PROPERTY_HINT_NODE_TYPE ), "set_onPointerAdded", "get_onPointerAdded" );
// onPointerRemoved: RJAction*
ClassDB::bind_method( D_METHOD( "set_onPointerRemoved", "onPointerRemoved" ), &RJPointable::set_onPointerRemoved );
ClassDB::bind_method( D_METHOD( "get_onPointerRemoved"), &RJPointable::get_onPointerRemoved);
ADD_PROPERTY( PropertyInfo(Variant::OBJECT, "onPointerRemoved", PROPERTY_HINT_NODE_TYPE ), "set_onPointerRemoved", "get_onPointerRemoved" );
GDVIRTUAL_BIND( updatePointerState, "pointer", "pointed" );
GDVIRTUAL_BIND( getPointer, "index" );
GDVIRTUAL_BIND( numPointing );
}
// Constructor
RJPointable::RJPointable()
{
pointingPriority = 0;
}
// Destructor
RJPointable::~RJPointable()
{
}
// pointingPriority: int
int RJPointable::get_pointingPriority() { return pointingPriority; }
void RJPointable::set_pointingPriority( int p_pointingPriority ) { pointingPriority = p_pointingPriority; }
// onPointed: RJAction*
RJAction* RJPointable::get_onPointed() const { return onPointed; }
void RJPointable::set_onPointed( RJAction* p_onPointed ) { onPointed = p_onPointed; }
// onUnpointed: RJAction*
RJAction* RJPointable::get_onUnpointed() const { return onUnpointed; }
void RJPointable::set_onUnpointed( RJAction* p_onUnpointed ) { onUnpointed = p_onUnpointed; }
// onPointerAdded: RJAction*
RJAction* RJPointable::get_onPointerAdded() const { return onPointerAdded; }
void RJPointable::set_onPointerAdded( RJAction* p_onPointerAdded ) { onPointerAdded = p_onPointerAdded; }
// onPointerRemoved: RJAction*
RJAction* RJPointable::get_onPointerRemoved() const { return onPointerRemoved; }
void RJPointable::set_onPointerRemoved( RJAction* p_onPointerRemoved ) { onPointerRemoved = p_onPointerRemoved; }

75
RJPointable.h Normal file
View File

@ -0,0 +1,75 @@
/* RJPointable.h */
#ifndef ROKOJORI__POINTABLE_H
#define ROKOJORI__POINTABLE_H
#include "./RJGodotHeaders.h"
#include "./RJAction.h"
#include "./RJPointer.h"
#include "scene/3d/node_3d.h"
template<typename Type> class Ref;
class RJPointer;
class RJPointable : public Node3D
{
GDCLASS( RJPointable, Node3D );
protected:
static void _bind_methods();
// pointingPriority : int
int pointingPriority;
// onPointed : RJAction*
RJAction* onPointed = nullptr;
// onUnpointed : RJAction*
RJAction* onUnpointed = nullptr;
// onPointerAdded : RJAction*
RJAction* onPointerAdded = nullptr;
// onPointerRemoved : RJAction*
RJAction* onPointerRemoved = nullptr;
public:
// pointingPriority : int
int get_pointingPriority(); void set_pointingPriority( int p_pointingPriority );
// onPointed : RJAction*
RJAction* get_onPointed() const; void set_onPointed( RJAction* p_onPointed );
// onUnpointed : RJAction*
RJAction* get_onUnpointed() const; void set_onUnpointed( RJAction* p_onUnpointed );
// onPointerAdded : RJAction*
RJAction* get_onPointerAdded() const; void set_onPointerAdded( RJAction* p_onPointerAdded );
// onPointerRemoved : RJAction*
RJAction* get_onPointerRemoved() const; void set_onPointerRemoved( RJAction* p_onPointerRemoved );
// updatePointerState( Ref<RJPointer> pointer, bool pointed ) : void
GDVIRTUAL2( updatePointerState, Ref<RJPointer>, bool );
// getPointer( int index ) : Ref<RJPointer>
GDVIRTUAL1R( Ref<RJPointer>, getPointer, int );
// numPointing() : int
GDVIRTUAL0R( int, numPointing );
// Constructor
RJPointable();
// Destructor
~RJPointable();
};
#endif // ROKOJORI__POINTABLE_H

34
RJPointer.cpp Normal file
View File

@ -0,0 +1,34 @@
/* RJPointer.cpp */
#include "RJPointer.h"
// Registers fields, signals and methods for Godot
void RJPointer::_bind_methods()
{
// caster: RJCaster*
ClassDB::bind_method( D_METHOD( "set_caster", "caster" ), &RJPointer::set_caster );
ClassDB::bind_method( D_METHOD( "get_caster"), &RJPointer::get_caster);
ADD_PROPERTY( PropertyInfo(Variant::OBJECT, "caster", PROPERTY_HINT_NODE_TYPE ), "set_caster", "get_caster" );
GDVIRTUAL_BIND( getPointable, "index" );
}
// Constructor
RJPointer::RJPointer()
{
}
// Destructor
RJPointer::~RJPointer()
{
}
// caster: RJCaster*
RJCaster* RJPointer::get_caster() const { return caster; }
void RJPointer::set_caster( RJCaster* p_caster ) { caster = p_caster; }

45
RJPointer.h Normal file
View File

@ -0,0 +1,45 @@
/* RJPointer.h */
#ifndef ROKOJORI__POINTER_H
#define ROKOJORI__POINTER_H
#include "./RJGodotHeaders.h"
#include "./RJCaster.h"
#include "./RJPointable.h"
#include "scene/3d/node_3d.h"
template<typename Type> class Ref;
class RJPointable;
class RJPointer : public Node3D
{
GDCLASS( RJPointer, Node3D );
protected:
static void _bind_methods();
// caster : RJCaster*
RJCaster* caster = nullptr;
public:
// caster : RJCaster*
RJCaster* get_caster() const; void set_caster( RJCaster* p_caster );
// getPointable( int index ) : Ref<RJPointable>
GDVIRTUAL1R( Ref<RJPointable>, getPointable, int );
// Constructor
RJPointer();
// Destructor
~RJPointer();
};
#endif // ROKOJORI__POINTER_H

View File

@ -1,19 +1,26 @@
/* RJSelector.cpp */
#include "RJSelector.h"
// Registers fields, signals and methods for Godot
void RJSelector::_bind_methods()
{
GDVIRTUAL_BIND( select );
GDVIRTUAL_BIND( selects, "node" );
}
// Constructor
RJSelector::RJSelector()
{
}
// Destructor
RJSelector::~RJSelector()
{
}

View File

@ -1,26 +1,37 @@
/* RJSelector.h */
#ifndef ROKOJORI__SELECTOR_H
#define ROKOJORI__SELECTOR_H
#include "./RJGodotHeaders.h"
#include "scene/main/node.h"
#include "core/io/resource.h"
class RJSelector : public Resource
{
GDCLASS( RJSelector, Resource );
protected:
static void _bind_methods();
GDVIRTUAL1R( bool, select, Ref<Node>)
public:
RJSelector();
~RJSelector();
// selects( Ref<Node> node ) : bool
GDVIRTUAL1R( bool, selects, Ref<Node> );
// Constructor
RJSelector();
// Destructor
~RJSelector();
};

View File

@ -1,23 +1,29 @@
/* RJSensor.cpp */
#include "RJSensor.h"
// Registers fields, signals and methods for Godot
void RJSensor::_bind_methods()
{
GDVIRTUAL_BIND( getValue );
GDVIRTUAL_BIND( isActive );
GDVIRTUAL_BIND( wasActive );
GDVIRTUAL_BIND( updateValue );
GDVIRTUAL_BIND( updateValue, "value" );
}
// Constructor
RJSensor::RJSensor()
{
}
// Destructor
RJSensor::~RJSensor()
{
}

View File

@ -1,11 +1,15 @@
/* RJSensor.h */
#ifndef ROKOJORI__SENSOR_H
#define ROKOJORI__SENSOR_H
#include "./RJGodotHeaders.h"
#include "./RJNetworkNode.h"
class RJSensor : public RJNetworkNode
{
GDCLASS( RJSensor, RJNetworkNode );
@ -13,14 +17,28 @@ class RJSensor : public RJNetworkNode
protected:
static void _bind_methods();
public:
// getValue() : float
GDVIRTUAL0R( float, getValue );
// isActive() : bool
GDVIRTUAL0R( bool, isActive );
// wasActive() : bool
GDVIRTUAL0R( bool, wasActive );
// updateValue( float value ) : void
GDVIRTUAL1( updateValue, float );
// Constructor
RJSensor();
// Destructor
~RJSensor();
};

View File

@ -6,7 +6,7 @@
void RJSequenceAction::_bind_methods()
{
GDVIRTUAL_BIND( cancelAction );
GDVIRTUAL_BIND( cancelAction, "id" );
ClassDB::bind_method( D_METHOD( "dispatchStart" ) , &RJSequenceAction::dispatchStart );
ClassDB::bind_method( D_METHOD( "dispatchCancelled" ) , &RJSequenceAction::dispatchCancelled );

View File

@ -1,25 +0,0 @@
/* RJStringProperty.cpp */
#include "RJStringProperty.h"
void RJStringProperty::_bind_methods()
{
GDVIRTUAL_BIND( set, "value" );
GDVIRTUAL_BIND( get );
ADD_SIGNAL (MethodInfo( "onChange" ) );
}
RJStringProperty::RJStringProperty()
{
}
RJStringProperty::~RJStringProperty()
{
}

View File

@ -1,33 +0,0 @@
/* RJStringProperty.h */
#ifndef ROKOJORI__STRING_PROPERTY_H
#define ROKOJORI__STRING_PROPERTY_H
#include "./RJNetworkNode.h"
class RJStringProperty : public RJNetworkNode
{
GDCLASS(RJStringProperty, RJNetworkNode);
protected:
static void _bind_methods();
public:
GDVIRTUAL1( set, String );
GDVIRTUAL0R( String, get );
/* signal onChange */
RJStringProperty();
~RJStringProperty();
};
#endif // ROKOJORI__STRING_PROPERTY_H

View File

@ -3,36 +3,37 @@
#include "RJTimeLine.h"
// Registers fields, signals and methods for Godot
void RJTimeLine::_bind_methods()
{
/* isLooping: bool */
// isLooping: bool
ClassDB::bind_method( D_METHOD( "set_isLooping", "isLooping" ), &RJTimeLine::set_isLooping );
ClassDB::bind_method( D_METHOD( "get_isLooping"), &RJTimeLine::get_isLooping);
ClassDB::bind_method(D_METHOD("set_isLooping"), &RJTimeLine::set_isLooping);
ADD_PROPERTY(PropertyInfo( Variant::BOOL, "isLooping" ), "set_isLooping", "get_isLooping" );
/* loopStart: float */
// loopStart: float
ClassDB::bind_method( D_METHOD( "set_loopStart", "loopStart" ), &RJTimeLine::set_loopStart );
ClassDB::bind_method( D_METHOD( "get_loopStart"), &RJTimeLine::get_loopStart);
ClassDB::bind_method(D_METHOD("set_loopStart"), &RJTimeLine::set_loopStart);
ADD_PROPERTY(PropertyInfo( Variant::FLOAT, "loopStart" ), "set_loopStart", "get_loopStart" );
/* loopEnd: float */
// loopEnd: float
ClassDB::bind_method( D_METHOD( "set_loopEnd", "loopEnd" ), &RJTimeLine::set_loopEnd );
ClassDB::bind_method( D_METHOD( "get_loopEnd"), &RJTimeLine::get_loopEnd);
ClassDB::bind_method(D_METHOD("set_loopEnd"), &RJTimeLine::set_loopEnd);
ADD_PROPERTY(PropertyInfo( Variant::FLOAT, "loopEnd" ), "set_loopEnd", "get_loopEnd" );
/* startSpeed: float */
// startSpeed: float
ClassDB::bind_method( D_METHOD( "set_startSpeed", "startSpeed" ), &RJTimeLine::set_startSpeed );
ClassDB::bind_method( D_METHOD( "get_startSpeed"), &RJTimeLine::get_startSpeed);
ClassDB::bind_method(D_METHOD("set_startSpeed"), &RJTimeLine::set_startSpeed);
ADD_PROPERTY(PropertyInfo( Variant::FLOAT, "startSpeed" ), "set_startSpeed", "get_startSpeed" );
/* autoStart: bool */
// autoStart: bool
ClassDB::bind_method( D_METHOD( "set_autoStart", "autoStart" ), &RJTimeLine::set_autoStart );
ClassDB::bind_method( D_METHOD( "get_autoStart"), &RJTimeLine::get_autoStart);
ClassDB::bind_method(D_METHOD("set_autoStart"), &RJTimeLine::set_autoStart);
ADD_PROPERTY(PropertyInfo( Variant::BOOL, "autoStart" ), "set_autoStart", "get_autoStart" );
}
// Constructor
RJTimeLine::RJTimeLine()
{
isLooping = false;
@ -42,29 +43,31 @@ RJTimeLine::RJTimeLine()
autoStart = false;
}
// Destructor
RJTimeLine::~RJTimeLine()
{
}
/* isLooping: bool */
// isLooping: bool
bool RJTimeLine::get_isLooping() { return isLooping; }
void RJTimeLine::set_isLooping( bool p_isLooping ) { isLooping = p_isLooping; }
/* loopStart: float */
// loopStart: float
float RJTimeLine::get_loopStart() { return loopStart; }
void RJTimeLine::set_loopStart( float p_loopStart ) { loopStart = p_loopStart; }
/* loopEnd: float */
// loopEnd: float
float RJTimeLine::get_loopEnd() { return loopEnd; }
void RJTimeLine::set_loopEnd( float p_loopEnd ) { loopEnd = p_loopEnd; }
/* startSpeed: float */
// startSpeed: float
float RJTimeLine::get_startSpeed() { return startSpeed; }
void RJTimeLine::set_startSpeed( float p_startSpeed ) { startSpeed = p_startSpeed; }
/* autoStart: bool */
// autoStart: bool
bool RJTimeLine::get_autoStart() { return autoStart; }
void RJTimeLine::set_autoStart( bool p_autoStart ) { autoStart = p_autoStart; }

View File

@ -4,10 +4,12 @@
#ifndef ROKOJORI__TIME_LINE_H
#define ROKOJORI__TIME_LINE_H
#include "./RJGodotHeaders.h"
#include "core/io/resource.h"
class RJTimeLine : public Resource
{
GDCLASS( RJTimeLine, Resource );
@ -16,22 +18,44 @@ protected:
static void _bind_methods();
// isLooping : bool
bool isLooping;
// loopStart : float
float loopStart;
// loopEnd : float
float loopEnd;
// startSpeed : float
float startSpeed;
// autoStart : bool
bool autoStart;
public:
// isLooping : bool
bool get_isLooping(); void set_isLooping( bool p_isLooping );
// loopStart : float
float get_loopStart(); void set_loopStart( float p_loopStart );
// loopEnd : float
float get_loopEnd(); void set_loopEnd( float p_loopEnd );
// startSpeed : float
float get_startSpeed(); void set_startSpeed( float p_startSpeed );
// autoStart : bool
bool get_autoStart(); void set_autoStart( bool p_autoStart );
// Constructor
RJTimeLine();
// Destructor
~RJTimeLine();
};

View File

@ -3,7 +3,7 @@
#include "RJTimeLineManager.h"
// Registers fields, signals and methods for Godot
void RJTimeLineManager::_bind_methods()
{
GDVIRTUAL_BIND( getTimeLineIndex, "timeLine" );
@ -22,11 +22,13 @@ void RJTimeLineManager::_bind_methods()
ADD_SIGNAL (MethodInfo( "onSpan" , PropertyInfo(Variant::INT, "callbackID"), PropertyInfo(Variant::INT, "spanType")) );
}
// Constructor
RJTimeLineManager::RJTimeLineManager()
{
}
// Destructor
RJTimeLineManager::~RJTimeLineManager()
{
@ -34,3 +36,4 @@ RJTimeLineManager::~RJTimeLineManager()

View File

@ -4,10 +4,13 @@
#ifndef ROKOJORI__TIME_LINE_MANAGER_H
#define ROKOJORI__TIME_LINE_MANAGER_H
#include "./RJGodotHeaders.h"
#include "./RJTimeLine.h"
#include "./RJNetworkNode.h"
class RJTimeLineManager : public RJNetworkNode
{
GDCLASS( RJTimeLineManager, RJNetworkNode );
@ -20,23 +23,51 @@ protected:
public:
GDVIRTUAL1R( int, getTimeLineIndex, Ref<RJTimeLine> );
GDVIRTUAL0R( int, getTimeLineSize );
GDVIRTUAL0R( int, createID );
GDVIRTUAL1R( double, getLastPosition, int );
GDVIRTUAL1R( double, getPosition, int );
GDVIRTUAL2( setPosition, int, double );
GDVIRTUAL1R( double, getSpeed, int );
GDVIRTUAL2( setSpeed, int, double );
GDVIRTUAL1R( bool, getPlayState, int );
GDVIRTUAL2( setPlayState, int, bool );
GDVIRTUAL4( scheduleEvent, int, double, int, bool );
GDVIRTUAL5( scheduleSpan, int, double, double, int, bool );
/* signal onEvent */
/* signal onSpan */
// getTimeLineIndex( Ref<RJTimeLine> timeLine ) : int
GDVIRTUAL1R( int, getTimeLineIndex, Ref<RJTimeLine> );
// getTimeLineSize() : int
GDVIRTUAL0R( int, getTimeLineSize );
// createID() : int
GDVIRTUAL0R( int, createID );
// getLastPosition( int timeLineIndex ) : double
GDVIRTUAL1R( double, getLastPosition, int );
// getPosition( int timeLineIndex ) : double
GDVIRTUAL1R( double, getPosition, int );
// setPosition( int timeLineIndex, double position ) : void
GDVIRTUAL2( setPosition, int, double );
// getSpeed( int timeLineIndex ) : double
GDVIRTUAL1R( double, getSpeed, int );
// setSpeed( int timeLineIndex, double speed ) : void
GDVIRTUAL2( setSpeed, int, double );
// getPlayState( int timeLineIndex ) : bool
GDVIRTUAL1R( bool, getPlayState, int );
// setPlayState( int timeLineIndex, bool playState ) : void
GDVIRTUAL2( setPlayState, int, bool );
// scheduleEvent( int timeLineIndex, double position, int callbackID, bool isPersistent ) : void
GDVIRTUAL4( scheduleEvent, int, double, int, bool );
// scheduleSpan( int timeLineIndex, double startPosition, double endPosition, int callbackID, bool isPersistent ) : void
GDVIRTUAL5( scheduleSpan, int, double, double, int, bool );
// [signal] onEvent( int callbackID ) : void
// [signal] onSpan( int callbackID, int spanType ) : void
// Constructor
RJTimeLineManager();
// Destructor
~RJTimeLineManager();
};

View File

@ -3,17 +3,19 @@
#include "RJUpdatable.h"
// Registers fields, signals and methods for Godot
void RJUpdatable::_bind_methods()
{
GDVIRTUAL_BIND( update, "delta" );
}
// Constructor
RJUpdatable::RJUpdatable()
{
}
// Destructor
RJUpdatable::~RJUpdatable()
{
@ -21,3 +23,4 @@ RJUpdatable::~RJUpdatable()

View File

@ -4,10 +4,12 @@
#ifndef ROKOJORI__UPDATABLE_H
#define ROKOJORI__UPDATABLE_H
#include "./RJGodotHeaders.h"
#include "./RJNetworkNode.h"
class RJUpdatable : public RJNetworkNode
{
GDCLASS( RJUpdatable, RJNetworkNode );
@ -20,10 +22,14 @@ protected:
public:
// update( double delta ) : void
GDVIRTUAL1( update, double );
// Constructor
RJUpdatable();
// Destructor
~RJUpdatable();
};

View File

@ -3,7 +3,7 @@
#include "RJVirtualCamera3D.h"
// Registers fields, signals and methods for Godot
void RJVirtualCamera3D::_bind_methods()
{
GDVIRTUAL_BIND( getCameraPosition );
@ -11,11 +11,13 @@ void RJVirtualCamera3D::_bind_methods()
GDVIRTUAL_BIND( getCameraFOV );
}
// Constructor
RJVirtualCamera3D::RJVirtualCamera3D()
{
}
// Destructor
RJVirtualCamera3D::~RJVirtualCamera3D()
{
@ -23,3 +25,4 @@ RJVirtualCamera3D::~RJVirtualCamera3D()

View File

@ -4,10 +4,12 @@
#ifndef ROKOJORI__VIRTUAL_CAMERA_3_D_H
#define ROKOJORI__VIRTUAL_CAMERA_3_D_H
#include "./RJGodotHeaders.h"
#include "scene/3d/node_3d.h"
class RJVirtualCamera3D : public Node3D
{
GDCLASS( RJVirtualCamera3D, Node3D );
@ -20,12 +22,20 @@ protected:
public:
// getCameraPosition() : Vector3
GDVIRTUAL0R( Vector3, getCameraPosition );
// getCameraRotation() : Quaternion
GDVIRTUAL0R( Quaternion, getCameraRotation );
// getCameraFOV() : float
GDVIRTUAL0R( float, getCameraFOV );
// Constructor
RJVirtualCamera3D();
// Destructor
~RJVirtualCamera3D();
};

View File

@ -3,7 +3,7 @@
#include "RJVirtualCamera3DManager.h"
// Registers fields, signals and methods for Godot
void RJVirtualCamera3DManager::_bind_methods()
{
GDVIRTUAL_BIND( getCamera, "cameraIndex" );
@ -11,35 +11,38 @@ void RJVirtualCamera3DManager::_bind_methods()
GDVIRTUAL_BIND( getCameraSize );
GDVIRTUAL_BIND( getCameraPriority, "cameraIndex" );
GDVIRTUAL_BIND( setCameraPriority, "cameraIndex", "priority" );
/* cameraPrioritySmoothingCoefficient: float */
// cameraPrioritySmoothingCoefficient: float
ClassDB::bind_method( D_METHOD( "set_cameraPrioritySmoothingCoefficient", "cameraPrioritySmoothingCoefficient" ), &RJVirtualCamera3DManager::set_cameraPrioritySmoothingCoefficient );
ClassDB::bind_method( D_METHOD( "get_cameraPrioritySmoothingCoefficient"), &RJVirtualCamera3DManager::get_cameraPrioritySmoothingCoefficient);
ClassDB::bind_method(D_METHOD("set_cameraPrioritySmoothingCoefficient"), &RJVirtualCamera3DManager::set_cameraPrioritySmoothingCoefficient);
ADD_PROPERTY(PropertyInfo( Variant::FLOAT, "cameraPrioritySmoothingCoefficient" ), "set_cameraPrioritySmoothingCoefficient", "get_cameraPrioritySmoothingCoefficient" );
/* cameraPrioritySmoothingStepFPS: float */
// cameraPrioritySmoothingStepFPS: float
ClassDB::bind_method( D_METHOD( "set_cameraPrioritySmoothingStepFPS", "cameraPrioritySmoothingStepFPS" ), &RJVirtualCamera3DManager::set_cameraPrioritySmoothingStepFPS );
ClassDB::bind_method( D_METHOD( "get_cameraPrioritySmoothingStepFPS"), &RJVirtualCamera3DManager::get_cameraPrioritySmoothingStepFPS);
ClassDB::bind_method(D_METHOD("set_cameraPrioritySmoothingStepFPS"), &RJVirtualCamera3DManager::set_cameraPrioritySmoothingStepFPS);
ADD_PROPERTY(PropertyInfo( Variant::FLOAT, "cameraPrioritySmoothingStepFPS" ), "set_cameraPrioritySmoothingStepFPS", "get_cameraPrioritySmoothingStepFPS" );
}
// Constructor
RJVirtualCamera3DManager::RJVirtualCamera3DManager()
{
cameraPrioritySmoothingCoefficient = 0.5;
cameraPrioritySmoothingStepFPS = 120;
}
// Destructor
RJVirtualCamera3DManager::~RJVirtualCamera3DManager()
{
}
/* cameraPrioritySmoothingCoefficient: float */
// cameraPrioritySmoothingCoefficient: float
float RJVirtualCamera3DManager::get_cameraPrioritySmoothingCoefficient() { return cameraPrioritySmoothingCoefficient; }
void RJVirtualCamera3DManager::set_cameraPrioritySmoothingCoefficient( float p_cameraPrioritySmoothingCoefficient ) { cameraPrioritySmoothingCoefficient = p_cameraPrioritySmoothingCoefficient; }
/* cameraPrioritySmoothingStepFPS: float */
// cameraPrioritySmoothingStepFPS: float
float RJVirtualCamera3DManager::get_cameraPrioritySmoothingStepFPS() { return cameraPrioritySmoothingStepFPS; }
void RJVirtualCamera3DManager::set_cameraPrioritySmoothingStepFPS( float p_cameraPrioritySmoothingStepFPS ) { cameraPrioritySmoothingStepFPS = p_cameraPrioritySmoothingStepFPS; }

View File

@ -4,10 +4,13 @@
#ifndef ROKOJORI__VIRTUAL_CAMERA_3_D_MANAGER_H
#define ROKOJORI__VIRTUAL_CAMERA_3_D_MANAGER_H
#include "./RJGodotHeaders.h"
#include "./RJVirtualCamera3D.h"
#include "./RJNetworkNode.h"
class RJVirtualCamera3DManager : public RJNetworkNode
{
GDCLASS( RJVirtualCamera3DManager, RJNetworkNode );
@ -16,21 +19,41 @@ protected:
static void _bind_methods();
// cameraPrioritySmoothingCoefficient : float
float cameraPrioritySmoothingCoefficient;
// cameraPrioritySmoothingStepFPS : float
float cameraPrioritySmoothingStepFPS;
public:
// getCamera( int cameraIndex ) : Ref<RJVirtualCamera3D>
GDVIRTUAL1R( Ref<RJVirtualCamera3D>, getCamera, int );
// getCameraIndex( Ref<RJVirtualCamera3D> timeLine ) : int
GDVIRTUAL1R( int, getCameraIndex, Ref<RJVirtualCamera3D> );
// getCameraSize() : int
GDVIRTUAL0R( int, getCameraSize );
// getCameraPriority( int cameraIndex ) : float
GDVIRTUAL1R( float, getCameraPriority, int );
// setCameraPriority( int cameraIndex, float priority ) : void
GDVIRTUAL2( setCameraPriority, int, float );
// cameraPrioritySmoothingCoefficient : float
float get_cameraPrioritySmoothingCoefficient(); void set_cameraPrioritySmoothingCoefficient( float p_cameraPrioritySmoothingCoefficient );
// cameraPrioritySmoothingStepFPS : float
float get_cameraPrioritySmoothingStepFPS(); void set_cameraPrioritySmoothingStepFPS( float p_cameraPrioritySmoothingStepFPS );
// Constructor
RJVirtualCamera3DManager();
// Destructor
~RJVirtualCamera3DManager();
};

View File

@ -4,20 +4,20 @@
#include "core/object/class_db.h"
#include "./RJNetworkNode.h"
#include "./RJAction.h"
#include "./RJCaster.h"
#include "./RJIntProperty.h"
#include "./RJNetworkNode.h"
#include "./RJPointable.h"
#include "./RJPointer.h"
#include "./RJSelector.h"
#include "./RJSensor.h"
#include "./RJSequenceAction.h"
#include "./RJUpdatable.h"
#include "./RJTimeLine.h"
#include "./RJTimeLineManager.h"
#include "./RJUpdatable.h"
#include "./RJVirtualCamera3D.h"
#include "./RJVirtualCamera3DManager.h"
#include "./RJBoolProperty.h"
#include "./RJNodeProperty.h"
#include "./RJNumberProperty.h"
#include "./RJStringProperty.h"
void initialize_rokojori_action_library_module( ModuleInitializationLevel p_level )
{
@ -26,20 +26,20 @@ void initialize_rokojori_action_library_module( ModuleInitializationLevel p_leve
return;
}
ClassDB::register_class<RJNetworkNode>();
ClassDB::register_class<RJAction>();
ClassDB::register_class<RJCaster>();
ClassDB::register_class<RJIntProperty>();
ClassDB::register_class<RJNetworkNode>();
ClassDB::register_class<RJPointable>();
ClassDB::register_class<RJPointer>();
ClassDB::register_class<RJSelector>();
ClassDB::register_class<RJSensor>();
ClassDB::register_class<RJSequenceAction>();
ClassDB::register_class<RJUpdatable>();
ClassDB::register_class<RJTimeLine>();
ClassDB::register_class<RJTimeLineManager>();
ClassDB::register_class<RJUpdatable>();
ClassDB::register_class<RJVirtualCamera3D>();
ClassDB::register_class<RJVirtualCamera3DManager>();
ClassDB::register_class<RJBoolProperty>();
ClassDB::register_class<RJNodeProperty>();
ClassDB::register_class<RJNumberProperty>();
ClassDB::register_class<RJStringProperty>();
}
void uninitialize_rokojori_action_library_module( ModuleInitializationLevel p_level )