diff options
Diffstat (limited to 'modules')
168 files changed, 1379 insertions, 2196 deletions
diff --git a/modules/SCsub b/modules/SCsub index c1cf5a6c1a..e3c535e981 100644 --- a/modules/SCsub +++ b/modules/SCsub @@ -17,6 +17,6 @@ for x in env.module_list: env_modules.Append(CPPFLAGS=["-DMODULE_" + x.upper() + "_ENABLED"]) SConscript(x + "/SCsub") -lib = env_modules.Library("modules", env.modules_sources) +lib = env_modules.add_library("modules", env.modules_sources) env.Prepend(LIBS=[lib]) diff --git a/modules/bullet/area_bullet.cpp b/modules/bullet/area_bullet.cpp index 54024b4f90..fad6f52cea 100644 --- a/modules/bullet/area_bullet.cpp +++ b/modules/bullet/area_bullet.cpp @@ -37,19 +37,19 @@ #include "collision_object_bullet.h" #include "space_bullet.h" -AreaBullet::AreaBullet() - : RigidCollisionObjectBullet(CollisionObjectBullet::TYPE_AREA), - monitorable(true), - isScratched(false), - spOv_mode(PhysicsServer::AREA_SPACE_OVERRIDE_DISABLED), - spOv_gravityPoint(false), - spOv_gravityPointDistanceScale(0), - spOv_gravityPointAttenuation(1), - spOv_gravityVec(0, -1, 0), - spOv_gravityMag(10), - spOv_linearDump(0.1), - spOv_angularDump(1), - spOv_priority(0) { +AreaBullet::AreaBullet() : + RigidCollisionObjectBullet(CollisionObjectBullet::TYPE_AREA), + monitorable(true), + isScratched(false), + spOv_mode(PhysicsServer::AREA_SPACE_OVERRIDE_DISABLED), + spOv_gravityPoint(false), + spOv_gravityPointDistanceScale(0), + spOv_gravityPointAttenuation(1), + spOv_gravityVec(0, -1, 0), + spOv_gravityMag(10), + spOv_linearDump(0.1), + spOv_angularDump(1), + spOv_priority(0) { btGhost = bulletnew(btGhostObject); btGhost->setCollisionShape(compoundShape); diff --git a/modules/bullet/area_bullet.h b/modules/bullet/area_bullet.h index f6e3b7e902..95ce62bfed 100644 --- a/modules/bullet/area_bullet.h +++ b/modules/bullet/area_bullet.h @@ -47,8 +47,8 @@ public: ObjectID event_callback_id; StringName event_callback_method; - InOutEventCallback() - : event_callback_id(0) {} + InOutEventCallback() : + event_callback_id(0) {} }; enum OverlapState { @@ -62,10 +62,12 @@ public: CollisionObjectBullet *object; OverlapState state; - OverlappingObjectData() - : object(NULL), state(OVERLAP_STATE_ENTER) {} - OverlappingObjectData(CollisionObjectBullet *p_object, OverlapState p_state) - : object(p_object), state(p_state) {} + OverlappingObjectData() : + object(NULL), + state(OVERLAP_STATE_ENTER) {} + OverlappingObjectData(CollisionObjectBullet *p_object, OverlapState p_state) : + object(p_object), + state(p_state) {} OverlappingObjectData(const OverlappingObjectData &other) { operator=(other); } diff --git a/modules/bullet/btRayShape.cpp b/modules/bullet/btRayShape.cpp index ac95faaac6..bbd2b19677 100644 --- a/modules/bullet/btRayShape.cpp +++ b/modules/bullet/btRayShape.cpp @@ -33,9 +33,9 @@ #include "LinearMath/btAabbUtil2.h" #include "math/math_funcs.h" -btRayShape::btRayShape(btScalar length) - : btConvexInternalShape(), - m_shapeAxis(0, 0, 1) { +btRayShape::btRayShape(btScalar length) : + btConvexInternalShape(), + m_shapeAxis(0, 0, 1) { m_shapeType = CUSTOM_CONVEX_SHAPE_TYPE; setLength(length); } diff --git a/modules/bullet/bullet_physics_server.cpp b/modules/bullet/bullet_physics_server.cpp index 7f95d16ba6..339dccce33 100644 --- a/modules/bullet/bullet_physics_server.cpp +++ b/modules/bullet/bullet_physics_server.cpp @@ -78,10 +78,10 @@ void BulletPhysicsServer::_bind_methods() { //ClassDB::bind_method(D_METHOD("DoTest"), &BulletPhysicsServer::DoTest); } -BulletPhysicsServer::BulletPhysicsServer() - : PhysicsServer(), - active(true), - active_spaces_count(0) {} +BulletPhysicsServer::BulletPhysicsServer() : + PhysicsServer(), + active(true), + active_spaces_count(0) {} BulletPhysicsServer::~BulletPhysicsServer() {} @@ -723,15 +723,15 @@ void BulletPhysicsServer::body_set_axis_velocity(RID p_body, const Vector3 &p_ax body->set_linear_velocity(v); } -void BulletPhysicsServer::body_set_axis_lock(RID p_body, PhysicsServer::BodyAxisLock p_lock) { +void BulletPhysicsServer::body_set_axis_lock(RID p_body, int axis, bool p_lock) { RigidBodyBullet *body = rigid_body_owner.get(p_body); ERR_FAIL_COND(!body); - body->set_axis_lock(p_lock); + body->set_axis_lock(axis, p_lock); } -PhysicsServer::BodyAxisLock BulletPhysicsServer::body_get_axis_lock(RID p_body) const { +bool BulletPhysicsServer::body_get_axis_lock(RID p_body) const { const RigidBodyBullet *body = rigid_body_owner.get(p_body); - ERR_FAIL_COND_V(!body, BODY_AXIS_LOCK_DISABLED); + ERR_FAIL_COND_V(!body, 0); return body->get_axis_lock(); } @@ -798,7 +798,7 @@ bool BulletPhysicsServer::body_is_omitting_force_integration(RID p_body) const { void BulletPhysicsServer::body_set_force_integration_callback(RID p_body, Object *p_receiver, const StringName &p_method, const Variant &p_udata) { RigidBodyBullet *body = rigid_body_owner.get(p_body); ERR_FAIL_COND(!body); - body->set_force_integration_callback(p_receiver->get_instance_id(), p_method, p_udata); + body->set_force_integration_callback(p_receiver ? p_receiver->get_instance_id() : ObjectID(0), p_method, p_udata); } void BulletPhysicsServer::body_set_ray_pickable(RID p_body, bool p_enable) { diff --git a/modules/bullet/bullet_physics_server.h b/modules/bullet/bullet_physics_server.h index ad8137ee2f..ed5acb9041 100644 --- a/modules/bullet/bullet_physics_server.h +++ b/modules/bullet/bullet_physics_server.h @@ -226,8 +226,8 @@ public: virtual void body_apply_torque_impulse(RID p_body, const Vector3 &p_impulse); virtual void body_set_axis_velocity(RID p_body, const Vector3 &p_axis_velocity); - virtual void body_set_axis_lock(RID p_body, BodyAxisLock p_lock); - virtual BodyAxisLock body_get_axis_lock(RID p_body) const; + virtual void body_set_axis_lock(RID p_body, int axis, bool p_lock); + virtual bool body_get_axis_lock(RID p_body) const; virtual void body_add_collision_exception(RID p_body, RID p_body_b); virtual void body_remove_collision_exception(RID p_body, RID p_body_b); diff --git a/modules/bullet/collision_object_bullet.cpp b/modules/bullet/collision_object_bullet.cpp index 91a049b1f3..da3a4b73cf 100644 --- a/modules/bullet/collision_object_bullet.cpp +++ b/modules/bullet/collision_object_bullet.cpp @@ -50,8 +50,14 @@ void CollisionObjectBullet::ShapeWrapper::set_transform(const btTransform &p_tra transform = p_transform; } -CollisionObjectBullet::CollisionObjectBullet(Type p_type) - : RIDBullet(), space(NULL), type(p_type), collisionsEnabled(true), m_isStatic(false), bt_collision_object(NULL), body_scale(1., 1., 1.) {} +CollisionObjectBullet::CollisionObjectBullet(Type p_type) : + RIDBullet(), + space(NULL), + type(p_type), + collisionsEnabled(true), + m_isStatic(false), + bt_collision_object(NULL), + body_scale(1., 1., 1.) {} CollisionObjectBullet::~CollisionObjectBullet() { // Remove all overlapping @@ -165,8 +171,9 @@ const btTransform &CollisionObjectBullet::get_transform__bullet() const { return bt_collision_object->getWorldTransform(); } -RigidCollisionObjectBullet::RigidCollisionObjectBullet(Type p_type) - : CollisionObjectBullet(p_type), compoundShape(bulletnew(btCompoundShape(enableDynamicAabbTree, initialChildCapacity))) { +RigidCollisionObjectBullet::RigidCollisionObjectBullet(Type p_type) : + CollisionObjectBullet(p_type), + compoundShape(bulletnew(btCompoundShape(enableDynamicAabbTree, initialChildCapacity))) { } RigidCollisionObjectBullet::~RigidCollisionObjectBullet() { @@ -285,10 +292,10 @@ void RigidCollisionObjectBullet::on_shapes_changed() { const int size = shapes.size(); for (i = 0; i < size; ++i) { shpWrapper = &shapes[i]; - if (!shpWrapper->bt_shape) { - shpWrapper->bt_shape = shpWrapper->shape->create_bt_shape(); - } if (shpWrapper->active) { + if (!shpWrapper->bt_shape) { + shpWrapper->bt_shape = shpWrapper->shape->create_bt_shape(); + } compoundShape->addChildShape(shpWrapper->transform, shpWrapper->bt_shape); } else { compoundShape->addChildShape(shpWrapper->transform, BulletPhysicsServer::get_empty_shape()); diff --git a/modules/bullet/collision_object_bullet.h b/modules/bullet/collision_object_bullet.h index 153b8ea5bc..51e48909e4 100644 --- a/modules/bullet/collision_object_bullet.h +++ b/modules/bullet/collision_object_bullet.h @@ -70,16 +70,22 @@ public: btTransform transform; bool active; - ShapeWrapper() - : shape(NULL), bt_shape(NULL), active(true) {} - - ShapeWrapper(ShapeBullet *p_shape, const btTransform &p_transform, bool p_active) - : shape(p_shape), bt_shape(NULL), active(p_active) { + ShapeWrapper() : + shape(NULL), + bt_shape(NULL), + active(true) {} + + ShapeWrapper(ShapeBullet *p_shape, const btTransform &p_transform, bool p_active) : + shape(p_shape), + bt_shape(NULL), + active(p_active) { set_transform(p_transform); } - ShapeWrapper(ShapeBullet *p_shape, const Transform &p_transform, bool p_active) - : shape(p_shape), bt_shape(NULL), active(p_active) { + ShapeWrapper(ShapeBullet *p_shape, const Transform &p_transform, bool p_active) : + shape(p_shape), + bt_shape(NULL), + active(p_active) { set_transform(p_transform); } ~ShapeWrapper(); diff --git a/modules/bullet/cone_twist_joint_bullet.cpp b/modules/bullet/cone_twist_joint_bullet.cpp index f6ac40e001..7ae5e79645 100644 --- a/modules/bullet/cone_twist_joint_bullet.cpp +++ b/modules/bullet/cone_twist_joint_bullet.cpp @@ -35,8 +35,8 @@ #include "bullet_utilities.h" #include "rigid_body_bullet.h" -ConeTwistJointBullet::ConeTwistJointBullet(RigidBodyBullet *rbA, RigidBodyBullet *rbB, const Transform &rbAFrame, const Transform &rbBFrame) - : JointBullet() { +ConeTwistJointBullet::ConeTwistJointBullet(RigidBodyBullet *rbA, RigidBodyBullet *rbB, const Transform &rbAFrame, const Transform &rbBFrame) : + JointBullet() { btTransform btFrameA; G_TO_B(rbAFrame, btFrameA); if (rbB) { diff --git a/modules/bullet/constraint_bullet.cpp b/modules/bullet/constraint_bullet.cpp index 08fc36f274..505579ce9b 100644 --- a/modules/bullet/constraint_bullet.cpp +++ b/modules/bullet/constraint_bullet.cpp @@ -33,8 +33,9 @@ #include "collision_object_bullet.h" #include "space_bullet.h" -ConstraintBullet::ConstraintBullet() - : space(NULL), constraint(NULL) {} +ConstraintBullet::ConstraintBullet() : + space(NULL), + constraint(NULL) {} void ConstraintBullet::setup(btTypedConstraint *p_constraint) { constraint = p_constraint; diff --git a/modules/bullet/doc_classes/BulletPhysicsDirectBodyState.xml b/modules/bullet/doc_classes/BulletPhysicsDirectBodyState.xml index 831b346942..941a79e8ea 100644 --- a/modules/bullet/doc_classes/BulletPhysicsDirectBodyState.xml +++ b/modules/bullet/doc_classes/BulletPhysicsDirectBodyState.xml @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="UTF-8" ?> -<class name="BulletPhysicsDirectBodyState" inherits="PhysicsDirectBodyState" category="Core" version="3.0-alpha"> +<class name="BulletPhysicsDirectBodyState" inherits="PhysicsDirectBodyState" category="Core" version="3.0-beta"> <brief_description> </brief_description> <description> diff --git a/modules/bullet/doc_classes/BulletPhysicsServer.xml b/modules/bullet/doc_classes/BulletPhysicsServer.xml index 4b5c2e6d83..515f0e292e 100644 --- a/modules/bullet/doc_classes/BulletPhysicsServer.xml +++ b/modules/bullet/doc_classes/BulletPhysicsServer.xml @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="UTF-8" ?> -<class name="BulletPhysicsServer" inherits="PhysicsServer" category="Core" version="3.0-alpha"> +<class name="BulletPhysicsServer" inherits="PhysicsServer" category="Core" version="3.0-beta"> <brief_description> </brief_description> <description> diff --git a/modules/bullet/generic_6dof_joint_bullet.cpp b/modules/bullet/generic_6dof_joint_bullet.cpp index 647396c24c..28928bd861 100644 --- a/modules/bullet/generic_6dof_joint_bullet.cpp +++ b/modules/bullet/generic_6dof_joint_bullet.cpp @@ -35,8 +35,8 @@ #include "bullet_utilities.h" #include "rigid_body_bullet.h" -Generic6DOFJointBullet::Generic6DOFJointBullet(RigidBodyBullet *rbA, RigidBodyBullet *rbB, const Transform &frameInA, const Transform &frameInB, bool useLinearReferenceFrameA) - : JointBullet() { +Generic6DOFJointBullet::Generic6DOFJointBullet(RigidBodyBullet *rbA, RigidBodyBullet *rbB, const Transform &frameInA, const Transform &frameInB, bool useLinearReferenceFrameA) : + JointBullet() { btTransform btFrameA; G_TO_B(frameInA, btFrameA); diff --git a/modules/bullet/godot_collision_configuration.cpp b/modules/bullet/godot_collision_configuration.cpp index 4e4228cc48..136fb2ee74 100644 --- a/modules/bullet/godot_collision_configuration.cpp +++ b/modules/bullet/godot_collision_configuration.cpp @@ -34,8 +34,8 @@ #include "BulletDynamics/Dynamics/btDiscreteDynamicsWorld.h" #include "godot_ray_world_algorithm.h" -GodotCollisionConfiguration::GodotCollisionConfiguration(const btDiscreteDynamicsWorld *world, const btDefaultCollisionConstructionInfo &constructionInfo) - : btDefaultCollisionConfiguration(constructionInfo) { +GodotCollisionConfiguration::GodotCollisionConfiguration(const btDiscreteDynamicsWorld *world, const btDefaultCollisionConstructionInfo &constructionInfo) : + btDefaultCollisionConfiguration(constructionInfo) { void *mem = NULL; diff --git a/modules/bullet/godot_collision_dispatcher.cpp b/modules/bullet/godot_collision_dispatcher.cpp index ea75e4eef4..e0ca29a8f3 100644 --- a/modules/bullet/godot_collision_dispatcher.cpp +++ b/modules/bullet/godot_collision_dispatcher.cpp @@ -34,8 +34,8 @@ const int GodotCollisionDispatcher::CASTED_TYPE_AREA = static_cast<int>(CollisionObjectBullet::TYPE_AREA); -GodotCollisionDispatcher::GodotCollisionDispatcher(btCollisionConfiguration *collisionConfiguration) - : btCollisionDispatcher(collisionConfiguration) {} +GodotCollisionDispatcher::GodotCollisionDispatcher(btCollisionConfiguration *collisionConfiguration) : + btCollisionDispatcher(collisionConfiguration) {} bool GodotCollisionDispatcher::needsCollision(const btCollisionObject *body0, const btCollisionObject *body1) { if (body0->getUserIndex() == CASTED_TYPE_AREA || body1->getUserIndex() == CASTED_TYPE_AREA) { diff --git a/modules/bullet/godot_motion_state.h b/modules/bullet/godot_motion_state.h index 5111807394..62ea472446 100644 --- a/modules/bullet/godot_motion_state.h +++ b/modules/bullet/godot_motion_state.h @@ -51,10 +51,10 @@ class GodotMotionState : public btMotionState { RigidBodyBullet *owner; public: - GodotMotionState(RigidBodyBullet *p_owner) - : bodyKinematicWorldTransf(btMatrix3x3(1., 0., 0., 0., 1., 0., 0., 0., 1.), btVector3(0., 0., 0.)), - bodyCurrentWorldTransform(btMatrix3x3(1., 0., 0., 0., 1., 0., 0., 0., 1.), btVector3(0., 0., 0.)), - owner(p_owner) {} + GodotMotionState(RigidBodyBullet *p_owner) : + bodyKinematicWorldTransf(btMatrix3x3(1., 0., 0., 0., 1., 0., 0., 0., 1.), btVector3(0., 0., 0.)), + bodyCurrentWorldTransform(btMatrix3x3(1., 0., 0., 0., 1., 0., 0., 0., 1.), btVector3(0., 0., 0.)), + owner(p_owner) {} /// IMPORTANT DON'T USE THIS FUNCTION TO KNOW THE CURRENT BODY TRANSFORM /// This class is used internally by Bullet diff --git a/modules/bullet/godot_ray_world_algorithm.cpp b/modules/bullet/godot_ray_world_algorithm.cpp index 98daf8398e..ba13903548 100644 --- a/modules/bullet/godot_ray_world_algorithm.cpp +++ b/modules/bullet/godot_ray_world_algorithm.cpp @@ -34,18 +34,18 @@ #include "btRayShape.h" #include "collision_object_bullet.h" -GodotRayWorldAlgorithm::CreateFunc::CreateFunc(const btDiscreteDynamicsWorld *world) - : m_world(world) {} - -GodotRayWorldAlgorithm::SwappedCreateFunc::SwappedCreateFunc(const btDiscreteDynamicsWorld *world) - : m_world(world) {} - -GodotRayWorldAlgorithm::GodotRayWorldAlgorithm(const btDiscreteDynamicsWorld *world, btPersistentManifold *mf, const btCollisionAlgorithmConstructionInfo &ci, const btCollisionObjectWrapper *body0Wrap, const btCollisionObjectWrapper *body1Wrap, bool isSwapped) - : btActivatingCollisionAlgorithm(ci, body0Wrap, body1Wrap), - m_manifoldPtr(mf), - m_ownManifold(false), - m_world(world), - m_isSwapped(isSwapped) {} +GodotRayWorldAlgorithm::CreateFunc::CreateFunc(const btDiscreteDynamicsWorld *world) : + m_world(world) {} + +GodotRayWorldAlgorithm::SwappedCreateFunc::SwappedCreateFunc(const btDiscreteDynamicsWorld *world) : + m_world(world) {} + +GodotRayWorldAlgorithm::GodotRayWorldAlgorithm(const btDiscreteDynamicsWorld *world, btPersistentManifold *mf, const btCollisionAlgorithmConstructionInfo &ci, const btCollisionObjectWrapper *body0Wrap, const btCollisionObjectWrapper *body1Wrap, bool isSwapped) : + btActivatingCollisionAlgorithm(ci, body0Wrap, body1Wrap), + m_manifoldPtr(mf), + m_ownManifold(false), + m_world(world), + m_isSwapped(isSwapped) {} GodotRayWorldAlgorithm::~GodotRayWorldAlgorithm() { if (m_ownManifold && m_manifoldPtr) { diff --git a/modules/bullet/godot_result_callbacks.h b/modules/bullet/godot_result_callbacks.h index ba5142676b..9d2fb1fce4 100644 --- a/modules/bullet/godot_result_callbacks.h +++ b/modules/bullet/godot_result_callbacks.h @@ -50,12 +50,21 @@ struct GodotFilterCallback : public btOverlapFilterCallback { struct GodotClosestRayResultCallback : public btCollisionWorld::ClosestRayResultCallback { const Set<RID> *m_exclude; bool m_pickRay; + int m_shapeId; public: - GodotClosestRayResultCallback(const btVector3 &rayFromWorld, const btVector3 &rayToWorld, const Set<RID> *p_exclude) - : btCollisionWorld::ClosestRayResultCallback(rayFromWorld, rayToWorld), m_exclude(p_exclude), m_pickRay(false) {} + GodotClosestRayResultCallback(const btVector3 &rayFromWorld, const btVector3 &rayToWorld, const Set<RID> *p_exclude) : + btCollisionWorld::ClosestRayResultCallback(rayFromWorld, rayToWorld), + m_exclude(p_exclude), + m_pickRay(false), + m_shapeId(0) {} virtual bool needsCollision(btBroadphaseProxy *proxy0) const; + + virtual btScalar addSingleResult(btCollisionWorld::LocalRayResult &rayResult, bool normalInWorldSpace) { + m_shapeId = rayResult.m_localShapeInfo->m_triangleIndex; // "m_triangleIndex" Is a odd name but contains the compound shape ID + return btCollisionWorld::ClosestRayResultCallback::addSingleResult(rayResult, normalInWorldSpace); + } }; // store all colliding object @@ -66,8 +75,11 @@ public: int count; const Set<RID> *m_exclude; - GodotAllConvexResultCallback(PhysicsDirectSpaceState::ShapeResult *p_results, int p_resultMax, const Set<RID> *p_exclude) - : m_results(p_results), m_exclude(p_exclude), m_resultMax(p_resultMax), count(0) {} + GodotAllConvexResultCallback(PhysicsDirectSpaceState::ShapeResult *p_results, int p_resultMax, const Set<RID> *p_exclude) : + m_results(p_results), + m_exclude(p_exclude), + m_resultMax(p_resultMax), + count(0) {} virtual bool needsCollision(btBroadphaseProxy *proxy0) const; @@ -79,8 +91,10 @@ public: const RigidBodyBullet *m_self_object; const bool m_ignore_areas; - GodotKinClosestConvexResultCallback(const btVector3 &convexFromWorld, const btVector3 &convexToWorld, const RigidBodyBullet *p_self_object, bool p_ignore_areas) - : btCollisionWorld::ClosestConvexResultCallback(convexFromWorld, convexToWorld), m_self_object(p_self_object), m_ignore_areas(p_ignore_areas) {} + GodotKinClosestConvexResultCallback(const btVector3 &convexFromWorld, const btVector3 &convexToWorld, const RigidBodyBullet *p_self_object, bool p_ignore_areas) : + btCollisionWorld::ClosestConvexResultCallback(convexFromWorld, convexToWorld), + m_self_object(p_self_object), + m_ignore_areas(p_ignore_areas) {} virtual bool needsCollision(btBroadphaseProxy *proxy0) const; }; @@ -90,8 +104,9 @@ public: const Set<RID> *m_exclude; int m_shapeId; - GodotClosestConvexResultCallback(const btVector3 &convexFromWorld, const btVector3 &convexToWorld, const Set<RID> *p_exclude) - : btCollisionWorld::ClosestConvexResultCallback(convexFromWorld, convexToWorld), m_exclude(p_exclude) {} + GodotClosestConvexResultCallback(const btVector3 &convexFromWorld, const btVector3 &convexToWorld, const Set<RID> *p_exclude) : + btCollisionWorld::ClosestConvexResultCallback(convexFromWorld, convexToWorld), + m_exclude(p_exclude) {} virtual bool needsCollision(btBroadphaseProxy *proxy0) const; @@ -106,8 +121,12 @@ public: int m_count; const Set<RID> *m_exclude; - GodotAllContactResultCallback(btCollisionObject *p_self_object, PhysicsDirectSpaceState::ShapeResult *p_results, int p_resultMax, const Set<RID> *p_exclude) - : m_self_object(p_self_object), m_results(p_results), m_exclude(p_exclude), m_resultMax(p_resultMax), m_count(0) {} + GodotAllContactResultCallback(btCollisionObject *p_self_object, PhysicsDirectSpaceState::ShapeResult *p_results, int p_resultMax, const Set<RID> *p_exclude) : + m_self_object(p_self_object), + m_results(p_results), + m_exclude(p_exclude), + m_resultMax(p_resultMax), + m_count(0) {} virtual bool needsCollision(btBroadphaseProxy *proxy0) const; @@ -123,8 +142,12 @@ public: int m_count; const Set<RID> *m_exclude; - GodotContactPairContactResultCallback(btCollisionObject *p_self_object, Vector3 *p_results, int p_resultMax, const Set<RID> *p_exclude) - : m_self_object(p_self_object), m_results(p_results), m_exclude(p_exclude), m_resultMax(p_resultMax), m_count(0) {} + GodotContactPairContactResultCallback(btCollisionObject *p_self_object, Vector3 *p_results, int p_resultMax, const Set<RID> *p_exclude) : + m_self_object(p_self_object), + m_results(p_results), + m_exclude(p_exclude), + m_resultMax(p_resultMax), + m_count(0) {} virtual bool needsCollision(btBroadphaseProxy *proxy0) const; @@ -141,8 +164,12 @@ public: btVector3 m_rest_info_bt_point; const Set<RID> *m_exclude; - GodotRestInfoContactResultCallback(btCollisionObject *p_self_object, PhysicsDirectSpaceState::ShapeRestInfo *p_result, const Set<RID> *p_exclude) - : m_self_object(p_self_object), m_result(p_result), m_exclude(p_exclude), m_collided(false), m_min_distance(0) {} + GodotRestInfoContactResultCallback(btCollisionObject *p_self_object, PhysicsDirectSpaceState::ShapeRestInfo *p_result, const Set<RID> *p_exclude) : + m_self_object(p_self_object), + m_result(p_result), + m_exclude(p_exclude), + m_collided(false), + m_min_distance(0) {} virtual bool needsCollision(btBroadphaseProxy *proxy0) const; @@ -158,12 +185,12 @@ struct GodotDeepPenetrationContactResultCallback : public btManifoldResult { btScalar m_most_penetrated_distance; - GodotDeepPenetrationContactResultCallback(const btCollisionObjectWrapper *body0Wrap, const btCollisionObjectWrapper *body1Wrap) - : btManifoldResult(body0Wrap, body1Wrap), - m_pointCollisionObject(NULL), - m_penetration_distance(0), - m_other_compound_shape_index(0), - m_most_penetrated_distance(1e20) {} + GodotDeepPenetrationContactResultCallback(const btCollisionObjectWrapper *body0Wrap, const btCollisionObjectWrapper *body1Wrap) : + btManifoldResult(body0Wrap, body1Wrap), + m_pointCollisionObject(NULL), + m_penetration_distance(0), + m_other_compound_shape_index(0), + m_most_penetrated_distance(1e20) {} void reset() { m_pointCollisionObject = NULL; diff --git a/modules/bullet/hinge_joint_bullet.cpp b/modules/bullet/hinge_joint_bullet.cpp index bb70babd99..d3288807b3 100644 --- a/modules/bullet/hinge_joint_bullet.cpp +++ b/modules/bullet/hinge_joint_bullet.cpp @@ -35,8 +35,8 @@ #include "bullet_utilities.h" #include "rigid_body_bullet.h" -HingeJointBullet::HingeJointBullet(RigidBodyBullet *rbA, RigidBodyBullet *rbB, const Transform &frameA, const Transform &frameB) - : JointBullet() { +HingeJointBullet::HingeJointBullet(RigidBodyBullet *rbA, RigidBodyBullet *rbB, const Transform &frameA, const Transform &frameB) : + JointBullet() { btTransform btFrameA; G_TO_B(frameA, btFrameA); @@ -53,8 +53,8 @@ HingeJointBullet::HingeJointBullet(RigidBodyBullet *rbA, RigidBodyBullet *rbB, c setup(hingeConstraint); } -HingeJointBullet::HingeJointBullet(RigidBodyBullet *rbA, RigidBodyBullet *rbB, const Vector3 &pivotInA, const Vector3 &pivotInB, const Vector3 &axisInA, const Vector3 &axisInB) - : JointBullet() { +HingeJointBullet::HingeJointBullet(RigidBodyBullet *rbA, RigidBodyBullet *rbB, const Vector3 &pivotInA, const Vector3 &pivotInB, const Vector3 &axisInA, const Vector3 &axisInB) : + JointBullet() { btVector3 btPivotA; btVector3 btAxisA; diff --git a/modules/bullet/joint_bullet.cpp b/modules/bullet/joint_bullet.cpp index be544f89bf..c8d91aa257 100644 --- a/modules/bullet/joint_bullet.cpp +++ b/modules/bullet/joint_bullet.cpp @@ -32,7 +32,7 @@ #include "joint_bullet.h" #include "space_bullet.h" -JointBullet::JointBullet() - : ConstraintBullet() {} +JointBullet::JointBullet() : + ConstraintBullet() {} JointBullet::~JointBullet() {} diff --git a/modules/bullet/pin_joint_bullet.cpp b/modules/bullet/pin_joint_bullet.cpp index cd9e9a4557..8c74fcbc94 100644 --- a/modules/bullet/pin_joint_bullet.cpp +++ b/modules/bullet/pin_joint_bullet.cpp @@ -34,8 +34,8 @@ #include "bullet_types_converter.h" #include "rigid_body_bullet.h" -PinJointBullet::PinJointBullet(RigidBodyBullet *p_body_a, const Vector3 &p_pos_a, RigidBodyBullet *p_body_b, const Vector3 &p_pos_b) - : JointBullet() { +PinJointBullet::PinJointBullet(RigidBodyBullet *p_body_a, const Vector3 &p_pos_a, RigidBodyBullet *p_body_b, const Vector3 &p_pos_b) : + JointBullet() { if (p_body_b) { btVector3 btPivotA; diff --git a/modules/bullet/rigid_body_bullet.cpp b/modules/bullet/rigid_body_bullet.cpp index 98ae82bc5f..843bdab31f 100644 --- a/modules/bullet/rigid_body_bullet.cpp +++ b/modules/bullet/rigid_body_bullet.cpp @@ -176,9 +176,9 @@ PhysicsDirectSpaceState *BulletPhysicsDirectBodyState::get_space_state() { return body->get_space()->get_direct_state(); } -RigidBodyBullet::KinematicUtilities::KinematicUtilities(RigidBodyBullet *p_owner) - : owner(p_owner), - safe_margin(0.001) { +RigidBodyBullet::KinematicUtilities::KinematicUtilities(RigidBodyBullet *p_owner) : + owner(p_owner), + safe_margin(0.001) { } RigidBodyBullet::KinematicUtilities::~KinematicUtilities() { @@ -250,22 +250,22 @@ void RigidBodyBullet::KinematicUtilities::just_delete_shapes(int new_size) { shapes.resize(new_size); } -RigidBodyBullet::RigidBodyBullet() - : RigidCollisionObjectBullet(CollisionObjectBullet::TYPE_RIGID_BODY), - kinematic_utilities(NULL), - gravity_scale(1), - mass(1), - linearDamp(0), - angularDamp(0), - can_sleep(true), - force_integration_callback(NULL), - isTransformChanged(false), - maxCollisionsDetection(0), - collisionsCount(0), - maxAreasWhereIam(10), - areaWhereIamCount(0), - countGravityPointSpaces(0), - isScratchedSpaceOverrideModificator(false) { +RigidBodyBullet::RigidBodyBullet() : + RigidCollisionObjectBullet(CollisionObjectBullet::TYPE_RIGID_BODY), + kinematic_utilities(NULL), + gravity_scale(1), + mass(1), + linearDamp(0), + angularDamp(0), + can_sleep(true), + force_integration_callback(NULL), + isTransformChanged(false), + maxCollisionsDetection(0), + collisionsCount(0), + maxAreasWhereIam(10), + areaWhereIamCount(0), + countGravityPointSpaces(0), + isScratchedSpaceOverrideModificator(false) { godotMotionState = bulletnew(GodotMotionState(this)); @@ -277,7 +277,7 @@ RigidBodyBullet::RigidBodyBullet() setupBulletCollisionObject(btBody); set_mode(PhysicsServer::BODY_MODE_RIGID); - set_axis_lock(PhysicsServer::BODY_AXIS_LOCK_DISABLED); + set_axis_lock(0, locked_axis[0]); areasWhereIam.resize(maxAreasWhereIam); for (int i = areasWhereIam.size() - 1; 0 <= i; --i) { @@ -498,25 +498,27 @@ void RigidBodyBullet::set_mode(PhysicsServer::BodyMode p_mode) { switch (p_mode) { case PhysicsServer::BODY_MODE_KINEMATIC: mode = PhysicsServer::BODY_MODE_KINEMATIC; - set_axis_lock(axis_lock); // Reload axis lock + set_axis_lock(0, locked_axis[0]); // Reload axis lock _internal_set_mass(0); init_kinematic_utilities(); break; case PhysicsServer::BODY_MODE_STATIC: mode = PhysicsServer::BODY_MODE_STATIC; - set_axis_lock(axis_lock); // Reload axis lock + set_axis_lock(0, locked_axis[0]); // Reload axis lock _internal_set_mass(0); break; case PhysicsServer::BODY_MODE_RIGID: { mode = PhysicsServer::BODY_MODE_RIGID; - set_axis_lock(axis_lock); // Reload axis lock + set_axis_lock(0, locked_axis[0]); // Reload axis lock _internal_set_mass(0 == mass ? 1 : mass); + scratch_space_override_modificator(); break; } case PhysicsServer::BODY_MODE_CHARACTER: { mode = PhysicsServer::BODY_MODE_CHARACTER; - set_axis_lock(axis_lock); // Reload axis lock + set_axis_lock(0, locked_axis[0]); // Reload axis lock _internal_set_mass(0 == mass ? 1 : mass); + scratch_space_override_modificator(); break; } } @@ -653,22 +655,14 @@ Vector3 RigidBodyBullet::get_applied_torque() const { return gTotTorq; } -void RigidBodyBullet::set_axis_lock(PhysicsServer::BodyAxisLock p_lock) { - axis_lock = p_lock; +void RigidBodyBullet::set_axis_lock(int axis, bool p_lock) { + locked_axis[axis] = p_lock; - if (PhysicsServer::BODY_AXIS_LOCK_DISABLED == axis_lock) { - btBody->setLinearFactor(btVector3(1., 1., 1.)); + btBody->setLinearFactor(btVector3(locked_axis[0] ? 0 : 1., locked_axis[1] ? 0 : 1., locked_axis[2] ? 0 : 1.)); + if (locked_axis[0] || locked_axis[1] || locked_axis[2]) + btBody->setAngularFactor(btVector3(locked_axis[0] ? 1. : 0, locked_axis[1] ? 1. : 0, locked_axis[2] ? 1. : 0)); + else btBody->setAngularFactor(btVector3(1., 1., 1.)); - } else if (PhysicsServer::BODY_AXIS_LOCK_X == axis_lock) { - btBody->setLinearFactor(btVector3(0., 1., 1.)); - btBody->setAngularFactor(btVector3(1., 0., 0.)); - } else if (PhysicsServer::BODY_AXIS_LOCK_Y == axis_lock) { - btBody->setLinearFactor(btVector3(1., 0., 1.)); - btBody->setAngularFactor(btVector3(0., 1., 0.)); - } else if (PhysicsServer::BODY_AXIS_LOCK_Z == axis_lock) { - btBody->setLinearFactor(btVector3(1., 1., 0.)); - btBody->setAngularFactor(btVector3(0., 0., 1.)); - } if (PhysicsServer::BODY_MODE_CHARACTER == mode) { /// When character lock angular @@ -676,17 +670,8 @@ void RigidBodyBullet::set_axis_lock(PhysicsServer::BodyAxisLock p_lock) { } } -PhysicsServer::BodyAxisLock RigidBodyBullet::get_axis_lock() const { - btVector3 vec = btBody->getLinearFactor(); - if (0. == vec.x()) { - return PhysicsServer::BODY_AXIS_LOCK_X; - } else if (0. == vec.y()) { - return PhysicsServer::BODY_AXIS_LOCK_Y; - } else if (0. == vec.z()) { - return PhysicsServer::BODY_AXIS_LOCK_Z; - } else { - return PhysicsServer::BODY_AXIS_LOCK_DISABLED; - } +bool RigidBodyBullet::get_axis_lock() const { + return locked_axis; } void RigidBodyBullet::set_continuous_collision_detection(bool p_enable) { diff --git a/modules/bullet/rigid_body_bullet.h b/modules/bullet/rigid_body_bullet.h index ab3c3e58b2..fde8b21e17 100644 --- a/modules/bullet/rigid_body_bullet.h +++ b/modules/bullet/rigid_body_bullet.h @@ -156,8 +156,8 @@ public: class btConvexShape *shape; btTransform transform; - KinematicShape() - : shape(NULL) {} + KinematicShape() : + shape(NULL) {} const bool is_active() const { return shape; } }; @@ -184,7 +184,7 @@ private: KinematicUtilities *kinematic_utilities; PhysicsServer::BodyMode mode; - PhysicsServer::BodyAxisLock axis_lock; + bool locked_axis[3] = { false, false, false }; GodotMotionState *godotMotionState; btRigidBody *btBody; real_t mass; @@ -269,8 +269,8 @@ public: void set_applied_torque(const Vector3 &p_torque); Vector3 get_applied_torque() const; - void set_axis_lock(PhysicsServer::BodyAxisLock p_lock); - PhysicsServer::BodyAxisLock get_axis_lock() const; + void set_axis_lock(int axis, bool p_lock); + bool get_axis_lock() const; /// Doc: /// http://www.bulletphysics.org/mediawiki-1.5.8/index.php?title=Anti_tunneling_by_Motion_Clamping diff --git a/modules/bullet/shape_bullet.cpp b/modules/bullet/shape_bullet.cpp index 49150484d9..572a3b4476 100644 --- a/modules/bullet/shape_bullet.cpp +++ b/modules/bullet/shape_bullet.cpp @@ -45,6 +45,7 @@ ShapeBullet::~ShapeBullet() {} btCollisionShape *ShapeBullet::prepare(btCollisionShape *p_btShape) const { p_btShape->setUserPointer(const_cast<ShapeBullet *>(this)); + p_btShape->setMargin(0.); return p_btShape; } @@ -129,8 +130,8 @@ btRayShape *ShapeBullet::create_shape_ray(real_t p_length) { /* PLANE */ -PlaneShapeBullet::PlaneShapeBullet() - : ShapeBullet() {} +PlaneShapeBullet::PlaneShapeBullet() : + ShapeBullet() {} void PlaneShapeBullet::set_data(const Variant &p_data) { setup(p_data); @@ -157,8 +158,8 @@ btCollisionShape *PlaneShapeBullet::create_bt_shape() { /* Sphere */ -SphereShapeBullet::SphereShapeBullet() - : ShapeBullet() {} +SphereShapeBullet::SphereShapeBullet() : + ShapeBullet() {} void SphereShapeBullet::set_data(const Variant &p_data) { setup(p_data); @@ -182,8 +183,8 @@ btCollisionShape *SphereShapeBullet::create_bt_shape() { } /* Box */ -BoxShapeBullet::BoxShapeBullet() - : ShapeBullet() {} +BoxShapeBullet::BoxShapeBullet() : + ShapeBullet() {} void BoxShapeBullet::set_data(const Variant &p_data) { setup(p_data); @@ -210,8 +211,8 @@ btCollisionShape *BoxShapeBullet::create_bt_shape() { /* Capsule */ -CapsuleShapeBullet::CapsuleShapeBullet() - : ShapeBullet() {} +CapsuleShapeBullet::CapsuleShapeBullet() : + ShapeBullet() {} void CapsuleShapeBullet::set_data(const Variant &p_data) { Dictionary d = p_data; @@ -243,8 +244,8 @@ btCollisionShape *CapsuleShapeBullet::create_bt_shape() { /* Convex polygon */ -ConvexPolygonShapeBullet::ConvexPolygonShapeBullet() - : ShapeBullet() {} +ConvexPolygonShapeBullet::ConvexPolygonShapeBullet() : + ShapeBullet() {} void ConvexPolygonShapeBullet::set_data(const Variant &p_data) { setup(p_data); @@ -285,8 +286,9 @@ btCollisionShape *ConvexPolygonShapeBullet::create_bt_shape() { /* Concave polygon */ -ConcavePolygonShapeBullet::ConcavePolygonShapeBullet() - : ShapeBullet(), meshShape(NULL) {} +ConcavePolygonShapeBullet::ConcavePolygonShapeBullet() : + ShapeBullet(), + meshShape(NULL) {} ConcavePolygonShapeBullet::~ConcavePolygonShapeBullet() { if (meshShape) { @@ -358,8 +360,8 @@ btCollisionShape *ConcavePolygonShapeBullet::create_bt_shape() { /* Height map shape */ -HeightMapShapeBullet::HeightMapShapeBullet() - : ShapeBullet() {} +HeightMapShapeBullet::HeightMapShapeBullet() : + ShapeBullet() {} void HeightMapShapeBullet::set_data(const Variant &p_data) { ERR_FAIL_COND(p_data.get_type() != Variant::DICTIONARY); @@ -410,8 +412,9 @@ btCollisionShape *HeightMapShapeBullet::create_bt_shape() { } /* Ray shape */ -RayShapeBullet::RayShapeBullet() - : ShapeBullet(), length(1) {} +RayShapeBullet::RayShapeBullet() : + ShapeBullet(), + length(1) {} void RayShapeBullet::set_data(const Variant &p_data) { setup(p_data); diff --git a/modules/bullet/slider_joint_bullet.cpp b/modules/bullet/slider_joint_bullet.cpp index 2da65677f5..f1d60679ec 100644 --- a/modules/bullet/slider_joint_bullet.cpp +++ b/modules/bullet/slider_joint_bullet.cpp @@ -35,8 +35,8 @@ #include "bullet_utilities.h" #include "rigid_body_bullet.h" -SliderJointBullet::SliderJointBullet(RigidBodyBullet *rbA, RigidBodyBullet *rbB, const Transform &frameInA, const Transform &frameInB) - : JointBullet() { +SliderJointBullet::SliderJointBullet(RigidBodyBullet *rbA, RigidBodyBullet *rbB, const Transform &frameInA, const Transform &frameInB) : + JointBullet() { btTransform btFrameA; G_TO_B(frameInA, btFrameA); if (rbB) { diff --git a/modules/bullet/soft_body_bullet.cpp b/modules/bullet/soft_body_bullet.cpp index 64ef7bfad2..ef5c8cac6f 100644 --- a/modules/bullet/soft_body_bullet.cpp +++ b/modules/bullet/soft_body_bullet.cpp @@ -36,8 +36,18 @@ #include "scene/3d/immediate_geometry.h" -SoftBodyBullet::SoftBodyBullet() - : CollisionObjectBullet(CollisionObjectBullet::TYPE_SOFT_BODY), mass(1), simulation_precision(5), stiffness(0.5f), pressure_coefficient(50), damping_coefficient(0.005), drag_coefficient(0.005), bt_soft_body(NULL), soft_shape_type(SOFT_SHAPETYPE_NONE), isScratched(false), soft_body_shape_data(NULL) { +SoftBodyBullet::SoftBodyBullet() : + CollisionObjectBullet(CollisionObjectBullet::TYPE_SOFT_BODY), + mass(1), + simulation_precision(5), + stiffness(0.5f), + pressure_coefficient(50), + damping_coefficient(0.005), + drag_coefficient(0.005), + bt_soft_body(NULL), + soft_shape_type(SOFT_SHAPETYPE_NONE), + isScratched(false), + soft_body_shape_data(NULL) { test_geometry = memnew(ImmediateGeometry); diff --git a/modules/bullet/space_bullet.cpp b/modules/bullet/space_bullet.cpp index 853906063b..3ce4b294db 100644 --- a/modules/bullet/space_bullet.cpp +++ b/modules/bullet/space_bullet.cpp @@ -50,10 +50,11 @@ #include "ustring.h" #include <assert.h> -BulletPhysicsDirectSpaceState::BulletPhysicsDirectSpaceState(SpaceBullet *p_space) - : PhysicsDirectSpaceState(), space(p_space) {} +BulletPhysicsDirectSpaceState::BulletPhysicsDirectSpaceState(SpaceBullet *p_space) : + PhysicsDirectSpaceState(), + space(p_space) {} -int BulletPhysicsDirectSpaceState::intersect_point(const Vector3 &p_point, ShapeResult *r_results, int p_result_max, const Set<RID> &p_exclude, uint32_t p_collision_layer, uint32_t p_object_type_mask) { +int BulletPhysicsDirectSpaceState::intersect_point(const Vector3 &p_point, ShapeResult *r_results, int p_result_max, const Set<RID> &p_exclude, uint32_t p_collision_mask) { if (p_result_max <= 0) return 0; @@ -68,15 +69,15 @@ int BulletPhysicsDirectSpaceState::intersect_point(const Vector3 &p_point, Shape // Setup query GodotAllContactResultCallback btResult(&collision_object_point, r_results, p_result_max, &p_exclude); - btResult.m_collisionFilterGroup = p_collision_layer; - btResult.m_collisionFilterMask = p_object_type_mask; + btResult.m_collisionFilterGroup = 0; + btResult.m_collisionFilterMask = p_collision_mask; space->dynamicsWorld->contactTest(&collision_object_point, btResult); // The results is already populated by GodotAllConvexResultCallback return btResult.m_count; } -bool BulletPhysicsDirectSpaceState::intersect_ray(const Vector3 &p_from, const Vector3 &p_to, RayResult &r_result, const Set<RID> &p_exclude, uint32_t p_collision_layer, uint32_t p_object_type_mask, bool p_pick_ray) { +bool BulletPhysicsDirectSpaceState::intersect_ray(const Vector3 &p_from, const Vector3 &p_to, RayResult &r_result, const Set<RID> &p_exclude, uint32_t p_collision_mask, bool p_pick_ray) { btVector3 btVec_from; btVector3 btVec_to; @@ -86,8 +87,8 @@ bool BulletPhysicsDirectSpaceState::intersect_ray(const Vector3 &p_from, const V // setup query GodotClosestRayResultCallback btResult(btVec_from, btVec_to, &p_exclude); - btResult.m_collisionFilterGroup = p_collision_layer; - btResult.m_collisionFilterMask = p_object_type_mask; + btResult.m_collisionFilterGroup = 0; + btResult.m_collisionFilterMask = p_collision_mask; btResult.m_pickRay = p_pick_ray; space->dynamicsWorld->rayTest(btVec_from, btVec_to, btResult); @@ -96,7 +97,7 @@ bool BulletPhysicsDirectSpaceState::intersect_ray(const Vector3 &p_from, const V B_TO_G(btResult.m_hitNormalWorld.normalize(), r_result.normal); CollisionObjectBullet *gObj = static_cast<CollisionObjectBullet *>(btResult.m_collisionObject->getUserPointer()); if (gObj) { - r_result.shape = 0; + r_result.shape = btResult.m_shapeId; r_result.rid = gObj->get_self(); r_result.collider_id = gObj->get_instance_id(); r_result.collider = 0 == r_result.collider_id ? NULL : ObjectDB::get_instance(r_result.collider_id); @@ -109,7 +110,7 @@ bool BulletPhysicsDirectSpaceState::intersect_ray(const Vector3 &p_from, const V } } -int BulletPhysicsDirectSpaceState::intersect_shape(const RID &p_shape, const Transform &p_xform, float p_margin, ShapeResult *p_results, int p_result_max, const Set<RID> &p_exclude, uint32_t p_collision_layer, uint32_t p_object_type_mask) { +int BulletPhysicsDirectSpaceState::intersect_shape(const RID &p_shape, const Transform &p_xform, float p_margin, ShapeResult *p_results, int p_result_max, const Set<RID> &p_exclude, uint32_t p_collision_mask) { if (p_result_max <= 0) return 0; @@ -135,8 +136,8 @@ int BulletPhysicsDirectSpaceState::intersect_shape(const RID &p_shape, const Tra collision_object.setWorldTransform(bt_xform); GodotAllContactResultCallback btQuery(&collision_object, p_results, p_result_max, &p_exclude); - btQuery.m_collisionFilterGroup = p_collision_layer; - btQuery.m_collisionFilterMask = p_object_type_mask; + btQuery.m_collisionFilterGroup = 0; + btQuery.m_collisionFilterMask = p_collision_mask; btQuery.m_closestDistanceThreshold = p_margin; space->dynamicsWorld->contactTest(&collision_object, btQuery); @@ -145,7 +146,7 @@ int BulletPhysicsDirectSpaceState::intersect_shape(const RID &p_shape, const Tra return btQuery.m_count; } -bool BulletPhysicsDirectSpaceState::cast_motion(const RID &p_shape, const Transform &p_xform, const Vector3 &p_motion, float p_margin, float &p_closest_safe, float &p_closest_unsafe, const Set<RID> &p_exclude, uint32_t p_collision_layer, uint32_t p_object_type_mask, ShapeRestInfo *r_info) { +bool BulletPhysicsDirectSpaceState::cast_motion(const RID &p_shape, const Transform &p_xform, const Vector3 &p_motion, float p_margin, float &p_closest_safe, float &p_closest_unsafe, const Set<RID> &p_exclude, uint32_t p_collision_mask, ShapeRestInfo *r_info) { ShapeBullet *shape = space->get_physics_server()->get_shape_owner()->get(p_shape); btCollisionShape *btShape = shape->create_bt_shape(); @@ -170,8 +171,8 @@ bool BulletPhysicsDirectSpaceState::cast_motion(const RID &p_shape, const Transf bt_xform_to.getOrigin() += bt_motion; GodotClosestConvexResultCallback btResult(bt_xform_from.getOrigin(), bt_xform_to.getOrigin(), &p_exclude); - btResult.m_collisionFilterGroup = p_collision_layer; - btResult.m_collisionFilterMask = p_object_type_mask; + btResult.m_collisionFilterGroup = 0; + btResult.m_collisionFilterMask = p_collision_mask; space->dynamicsWorld->convexSweepTest(bt_convex_shape, bt_xform_from, bt_xform_to, btResult, 0.002); @@ -195,7 +196,7 @@ bool BulletPhysicsDirectSpaceState::cast_motion(const RID &p_shape, const Transf } /// Returns the list of contacts pairs in this order: Local contact, other body contact -bool BulletPhysicsDirectSpaceState::collide_shape(RID p_shape, const Transform &p_shape_xform, float p_margin, Vector3 *r_results, int p_result_max, int &r_result_count, const Set<RID> &p_exclude, uint32_t p_collision_layer, uint32_t p_object_type_mask) { +bool BulletPhysicsDirectSpaceState::collide_shape(RID p_shape, const Transform &p_shape_xform, float p_margin, Vector3 *r_results, int p_result_max, int &r_result_count, const Set<RID> &p_exclude, uint32_t p_collision_mask) { if (p_result_max <= 0) return 0; @@ -221,8 +222,8 @@ bool BulletPhysicsDirectSpaceState::collide_shape(RID p_shape, const Transform & collision_object.setWorldTransform(bt_xform); GodotContactPairContactResultCallback btQuery(&collision_object, r_results, p_result_max, &p_exclude); - btQuery.m_collisionFilterGroup = p_collision_layer; - btQuery.m_collisionFilterMask = p_object_type_mask; + btQuery.m_collisionFilterGroup = 0; + btQuery.m_collisionFilterMask = p_collision_mask; btQuery.m_closestDistanceThreshold = p_margin; space->dynamicsWorld->contactTest(&collision_object, btQuery); @@ -232,7 +233,7 @@ bool BulletPhysicsDirectSpaceState::collide_shape(RID p_shape, const Transform & return btQuery.m_count; } -bool BulletPhysicsDirectSpaceState::rest_info(RID p_shape, const Transform &p_shape_xform, float p_margin, ShapeRestInfo *r_info, const Set<RID> &p_exclude, uint32_t p_collision_layer, uint32_t p_object_type_mask) { +bool BulletPhysicsDirectSpaceState::rest_info(RID p_shape, const Transform &p_shape_xform, float p_margin, ShapeRestInfo *r_info, const Set<RID> &p_exclude, uint32_t p_collision_mask) { ShapeBullet *shape = space->get_physics_server()->get_shape_owner()->get(p_shape); @@ -256,8 +257,8 @@ bool BulletPhysicsDirectSpaceState::rest_info(RID p_shape, const Transform &p_sh collision_object.setWorldTransform(bt_xform); GodotRestInfoContactResultCallback btQuery(&collision_object, r_info, &p_exclude); - btQuery.m_collisionFilterGroup = p_collision_layer; - btQuery.m_collisionFilterMask = p_object_type_mask; + btQuery.m_collisionFilterGroup = 0; + btQuery.m_collisionFilterMask = p_collision_mask; btQuery.m_closestDistanceThreshold = p_margin; space->dynamicsWorld->contactTest(&collision_object, btQuery); @@ -330,18 +331,18 @@ Vector3 BulletPhysicsDirectSpaceState::get_closest_point_to_object_volume(RID p_ } } -SpaceBullet::SpaceBullet(bool p_create_soft_world) - : broadphase(NULL), - dispatcher(NULL), - solver(NULL), - collisionConfiguration(NULL), - dynamicsWorld(NULL), - soft_body_world_info(NULL), - ghostPairCallback(NULL), - godotFilterCallback(NULL), - gravityDirection(0, -1, 0), - gravityMagnitude(10), - contactDebugCount(0) { +SpaceBullet::SpaceBullet(bool p_create_soft_world) : + broadphase(NULL), + dispatcher(NULL), + solver(NULL), + collisionConfiguration(NULL), + dynamicsWorld(NULL), + soft_body_world_info(NULL), + ghostPairCallback(NULL), + godotFilterCallback(NULL), + gravityDirection(0, -1, 0), + gravityMagnitude(10), + contactDebugCount(0) { create_empty_world(p_create_soft_world); direct_access = memnew(BulletPhysicsDirectSpaceState(this)); @@ -467,6 +468,7 @@ void SpaceBullet::add_rigid_body(RigidBodyBullet *p_body) { dynamicsWorld->addCollisionObject(p_body->get_bt_rigid_body(), p_body->get_collision_layer(), p_body->get_collision_mask()); } else { dynamicsWorld->addRigidBody(p_body->get_bt_rigid_body(), p_body->get_collision_layer(), p_body->get_collision_mask()); + p_body->scratch_space_override_modificator(); } } @@ -938,14 +940,14 @@ bool SpaceBullet::test_body_motion(RigidBodyBullet *p_body, const Transform &p_f r_result->collider_shape = r_recover_result.other_compound_shape_index; r_result->collision_local_shape = r_recover_result.local_shape_most_recovered; -//{ /// Add manifold point to manage collisions -// btPersistentManifold* manifold = dynamicsWorld->getDispatcher()->getNewManifold(p_body->getBtBody(), btRigid); -// btManifoldPoint manifoldPoint(result_callabck.m_pointWorld, result_callabck.m_pointWorld, result_callabck.m_pointNormalWorld, result_callabck.m_penetration_distance); -// manifoldPoint.m_index0 = r_result->collision_local_shape; -// manifoldPoint.m_index1 = r_result->collider_shape; -// manifold->addManifoldPoint(manifoldPoint); -// p_body->get_kinematic_utilities()->m_generatedManifold.push_back(manifold); -//} + //{ /// Add manifold point to manage collisions + // btPersistentManifold* manifold = dynamicsWorld->getDispatcher()->getNewManifold(p_body->getBtBody(), btRigid); + // btManifoldPoint manifoldPoint(result_callabck.m_pointWorld, result_callabck.m_pointWorld, result_callabck.m_pointNormalWorld, result_callabck.m_penetration_distance); + // manifoldPoint.m_index0 = r_result->collision_local_shape; + // manifoldPoint.m_index1 = r_result->collider_shape; + // manifold->addManifoldPoint(manifoldPoint); + // p_body->get_kinematic_utilities()->m_generatedManifold.push_back(manifold); + //} #if debug_test_motion Vector3 sup_line2; @@ -978,10 +980,10 @@ public: Vector<btCollisionObject *> result_collision_objects; public: - RecoverPenetrationBroadPhaseCallback(const btCollisionObject *p_self_collision_object, uint32_t p_collision_layer, uint32_t p_collision_mask) - : self_collision_object(p_self_collision_object), - collision_layer(p_collision_layer), - collision_mask(p_collision_mask) {} + RecoverPenetrationBroadPhaseCallback(const btCollisionObject *p_self_collision_object, uint32_t p_collision_layer, uint32_t p_collision_mask) : + self_collision_object(p_self_collision_object), + collision_layer(p_collision_layer), + collision_mask(p_collision_mask) {} virtual ~RecoverPenetrationBroadPhaseCallback() {} diff --git a/modules/bullet/space_bullet.h b/modules/bullet/space_bullet.h index 9acac9a7d6..e5267c01a9 100644 --- a/modules/bullet/space_bullet.h +++ b/modules/bullet/space_bullet.h @@ -69,13 +69,13 @@ private: public: BulletPhysicsDirectSpaceState(SpaceBullet *p_space); - virtual int intersect_point(const Vector3 &p_point, ShapeResult *r_results, int p_result_max, const Set<RID> &p_exclude = Set<RID>(), uint32_t p_collision_layer = 0xFFFFFFFF, uint32_t p_object_type_mask = TYPE_MASK_COLLISION); - virtual bool intersect_ray(const Vector3 &p_from, const Vector3 &p_to, RayResult &r_result, const Set<RID> &p_exclude = Set<RID>(), uint32_t p_collision_layer = 0xFFFFFFFF, uint32_t p_object_type_mask = TYPE_MASK_COLLISION, bool p_pick_ray = false); - virtual int intersect_shape(const RID &p_shape, const Transform &p_xform, float p_margin, ShapeResult *r_results, int p_result_max, const Set<RID> &p_exclude = Set<RID>(), uint32_t p_collision_layer = 0xFFFFFFFF, uint32_t p_object_type_mask = TYPE_MASK_COLLISION); - virtual bool cast_motion(const RID &p_shape, const Transform &p_xform, const Vector3 &p_motion, float p_margin, float &p_closest_safe, float &p_closest_unsafe, const Set<RID> &p_exclude = Set<RID>(), uint32_t p_collision_layer = 0xFFFFFFFF, uint32_t p_object_type_mask = TYPE_MASK_COLLISION, ShapeRestInfo *r_info = NULL); + virtual int intersect_point(const Vector3 &p_point, ShapeResult *r_results, int p_result_max, const Set<RID> &p_exclude = Set<RID>(), uint32_t p_collision_mask = 0xFFFFFFFF); + virtual bool intersect_ray(const Vector3 &p_from, const Vector3 &p_to, RayResult &r_result, const Set<RID> &p_exclude = Set<RID>(), uint32_t p_collision_mask = 0xFFFFFFFF, bool p_pick_ray = false); + virtual int intersect_shape(const RID &p_shape, const Transform &p_xform, float p_margin, ShapeResult *r_results, int p_result_max, const Set<RID> &p_exclude = Set<RID>(), uint32_t p_collision_mask = 0xFFFFFFFF); + virtual bool cast_motion(const RID &p_shape, const Transform &p_xform, const Vector3 &p_motion, float p_margin, float &p_closest_safe, float &p_closest_unsafe, const Set<RID> &p_exclude = Set<RID>(), uint32_t p_collision_mask = 0xFFFFFFFF, ShapeRestInfo *r_info = NULL); /// Returns the list of contacts pairs in this order: Local contact, other body contact - virtual bool collide_shape(RID p_shape, const Transform &p_shape_xform, float p_margin, Vector3 *r_results, int p_result_max, int &r_result_count, const Set<RID> &p_exclude = Set<RID>(), uint32_t p_collision_layer = 0xFFFFFFFF, uint32_t p_object_type_mask = TYPE_MASK_COLLISION); - virtual bool rest_info(RID p_shape, const Transform &p_shape_xform, float p_margin, ShapeRestInfo *r_info, const Set<RID> &p_exclude = Set<RID>(), uint32_t p_collision_layer = 0xFFFFFFFF, uint32_t p_object_type_mask = TYPE_MASK_COLLISION); + virtual bool collide_shape(RID p_shape, const Transform &p_shape_xform, float p_margin, Vector3 *r_results, int p_result_max, int &r_result_count, const Set<RID> &p_exclude = Set<RID>(), uint32_t p_collision_mask = 0xFFFFFFFF); + virtual bool rest_info(RID p_shape, const Transform &p_shape_xform, float p_margin, ShapeRestInfo *r_info, const Set<RID> &p_exclude = Set<RID>(), uint32_t p_collision_mask = 0xFFFFFFFF); virtual Vector3 get_closest_point_to_object_volume(RID p_object, const Vector3 p_point) const; }; @@ -185,8 +185,8 @@ private: const btCollisionObject *other_collision_object; int local_shape_most_recovered; - RecoverResult() - : hasPenetration(false) {} + RecoverResult() : + hasPenetration(false) {} }; bool recover_from_penetration(RigidBodyBullet *p_body, const btTransform &p_from, btVector3 &r_recover_position, RecoverResult *r_recover_result = NULL); diff --git a/modules/enet/doc_classes/NetworkedMultiplayerENet.xml b/modules/enet/doc_classes/NetworkedMultiplayerENet.xml index 70ef6aef20..25d17542ea 100644 --- a/modules/enet/doc_classes/NetworkedMultiplayerENet.xml +++ b/modules/enet/doc_classes/NetworkedMultiplayerENet.xml @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="UTF-8" ?> -<class name="NetworkedMultiplayerENet" inherits="NetworkedMultiplayerPeer" category="Core" version="3.0-alpha"> +<class name="NetworkedMultiplayerENet" inherits="NetworkedMultiplayerPeer" category="Core" version="3.0-beta"> <brief_description> PacketPeer implementation using the ENet library. </brief_description> @@ -71,15 +71,15 @@ </method> </methods> <constants> - <constant name="COMPRESS_NONE" value="0"> + <constant name="COMPRESS_NONE" value="0" enum="CompressionMode"> </constant> - <constant name="COMPRESS_RANGE_CODER" value="1"> + <constant name="COMPRESS_RANGE_CODER" value="1" enum="CompressionMode"> </constant> - <constant name="COMPRESS_FASTLZ" value="2"> + <constant name="COMPRESS_FASTLZ" value="2" enum="CompressionMode"> </constant> - <constant name="COMPRESS_ZLIB" value="3"> + <constant name="COMPRESS_ZLIB" value="3" enum="CompressionMode"> </constant> - <constant name="COMPRESS_ZSTD" value="4"> + <constant name="COMPRESS_ZSTD" value="4" enum="CompressionMode"> </constant> </constants> </class> diff --git a/modules/enet/networked_multiplayer_enet.cpp b/modules/enet/networked_multiplayer_enet.cpp index 1e18ec0d18..ce485956b4 100644 --- a/modules/enet/networked_multiplayer_enet.cpp +++ b/modules/enet/networked_multiplayer_enet.cpp @@ -585,7 +585,7 @@ size_t NetworkedMultiplayerENet::enet_compress(void *context, const ENetBuffer * if (enet->dst_compressor_mem.size() < req_size) { enet->dst_compressor_mem.resize(req_size); } - int ret = Compression::compress(enet->dst_compressor_mem.ptr(), enet->src_compressor_mem.ptr(), ofs, mode); + int ret = Compression::compress(enet->dst_compressor_mem.ptrw(), enet->src_compressor_mem.ptr(), ofs, mode); if (ret < 0) return 0; diff --git a/modules/freetype/SCsub b/modules/freetype/SCsub index 19e384af73..f69b632e76 100644 --- a/modules/freetype/SCsub +++ b/modules/freetype/SCsub @@ -68,7 +68,7 @@ if env['builtin_freetype']: if env['builtin_libpng']: env.Append(CPPPATH=["#thirdparty/libpng"]) - lib = env.Library("freetype_builtin", thirdparty_sources) + lib = env.add_library("freetype_builtin", thirdparty_sources) # Needs to be appended to arrive after libscene in the linker call, # but we don't want it to arrive *after* system libs, so manual hack # LIBS contains first SCons Library objects ("SCons.Node.FS.File object") diff --git a/modules/gdnative/SCsub b/modules/gdnative/SCsub index 485bf4b9df..fd11c8d094 100644 --- a/modules/gdnative/SCsub +++ b/modules/gdnative/SCsub @@ -19,19 +19,27 @@ def _spaced(e): return e if e[-1] == '*' else e + ' ' def _build_gdnative_api_struct_header(api): - ext_wrappers = '' + gdnative_api_init_macro = [ + '\textern const godot_gdnative_core_api_struct *_gdnative_wrapper_api_struct;' + ] for name in api['extensions']: - ext_wrappers += ' extern const godot_gdnative_ext_' + name + '_api_struct *_gdnative_wrapper_' + name + '_api_struct;' + gdnative_api_init_macro.append( + '\textern const godot_gdnative_ext_{0}_api_struct *_gdnative_wrapper_{0}_api_struct;'.format(name)) - ext_init = 'for (int i = 0; i < _gdnative_wrapper_api_struct->num_extensions; i++) { ' - ext_init += 'switch (_gdnative_wrapper_api_struct->extensions[i]->type) {' + gdnative_api_init_macro.append('\t_gdnative_wrapper_api_struct = options->api_struct;') + gdnative_api_init_macro.append('\tfor (int i = 0; i < _gdnative_wrapper_api_struct->num_extensions; i++) { ') + gdnative_api_init_macro.append('\t\tswitch (_gdnative_wrapper_api_struct->extensions[i]->type) {') for name in api['extensions']: - ext_init += 'case GDNATIVE_EXT_' + api['extensions'][name]['type'] + ': ' - ext_init += '_gdnative_wrapper_' + name + '_api_struct = (' + 'godot_gdnative_ext_' + name + '_api_struct *) _gdnative_wrapper_api_struct->extensions[i]; break;' - - ext_init += '}' + gdnative_api_init_macro.append( + '\t\t\tcase GDNATIVE_EXT_%s:' % api['extensions'][name]['type']) + gdnative_api_init_macro.append( + '\t\t\t\t_gdnative_wrapper_{0}_api_struct = (godot_gdnative_ext_{0}_api_struct *)' + ' _gdnative_wrapper_api_struct->extensions[i];'.format(name)) + gdnative_api_init_macro.append('\t\t\t\tbreak;') + gdnative_api_init_macro.append('\t\t}') + gdnative_api_init_macro.append('\t}') out = [ '/* THIS FILE IS GENERATED DO NOT EDIT */', @@ -43,7 +51,7 @@ def _build_gdnative_api_struct_header(api): '#include <nativescript/godot_nativescript.h>', '#include <pluginscript/godot_pluginscript.h>', '', - '#define GDNATIVE_API_INIT(options) do { extern const godot_gdnative_api_struct *_gdnative_wrapper_api_struct;' + ext_wrappers + ' _gdnative_wrapper_api_struct = options->api_struct; ' + ext_init + ' } while (0)', + '#define GDNATIVE_API_INIT(options) do { \\\n' + ' \\\n'.join(gdnative_api_init_macro) + ' \\\n } while (0)', '', '#ifdef __cplusplus', 'extern "C" {', @@ -179,7 +187,7 @@ def _build_gdnative_wrapper_code(api): ] for name in api['extensions']: - out.append('godot_gdnative_ext_' + name + '_api_struct *_gdnative_wrapper_' + name + '_api_struct;') + out.append('godot_gdnative_ext_' + name + '_api_struct *_gdnative_wrapper_' + name + '_api_struct = 0;') out += [''] @@ -237,7 +245,7 @@ if ARGUMENTS.get('gdnative_wrapper', False): gd_wrapper_env = env.Clone() gd_wrapper_env.Append(CPPPATH=['#modules/gdnative/include/']) - # I think this doesn't work on MSVC yet... - gd_wrapper_env.Append(CCFLAGS=['-fPIC']) + if not env.msvc: + gd_wrapper_env.Append(CCFLAGS=['-fPIC']) - gd_wrapper_env.Library("#bin/gdnative_wrapper_code", [gensource]) + lib = gd_wrapper_env.add_library("#bin/gdnative_wrapper_code", [gensource]) diff --git a/modules/gdnative/arvr/arvr_interface_gdnative.cpp b/modules/gdnative/arvr/arvr_interface_gdnative.cpp index 02f2ee7424..29e4775e62 100644 --- a/modules/gdnative/arvr/arvr_interface_gdnative.cpp +++ b/modules/gdnative/arvr/arvr_interface_gdnative.cpp @@ -219,7 +219,7 @@ extern "C" { void GDAPI godot_arvr_register_interface(const godot_arvr_interface_gdnative *p_interface) { Ref<ARVRInterfaceGDNative> new_interface; new_interface.instance(); - new_interface->set_interface((godot_arvr_interface_gdnative * const)p_interface); + new_interface->set_interface((godot_arvr_interface_gdnative *const)p_interface); ARVRServer::get_singleton()->add_interface(new_interface); } @@ -344,7 +344,7 @@ void GDAPI godot_arvr_set_controller_transform(godot_int p_controller_id, godot_ tracker->set_orientation(transform->basis); } if (p_tracks_position) { - tracker->set_position(transform->origin); + tracker->set_rw_position(transform->origin); } } } diff --git a/modules/gdnative/doc_classes/ARVRInterfaceGDNative.xml b/modules/gdnative/doc_classes/ARVRInterfaceGDNative.xml index 10957a3394..e4ffa76d36 100644 --- a/modules/gdnative/doc_classes/ARVRInterfaceGDNative.xml +++ b/modules/gdnative/doc_classes/ARVRInterfaceGDNative.xml @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="UTF-8" ?> -<class name="ARVRInterfaceGDNative" inherits="ARVRInterface" category="Core" version="3.0-alpha"> +<class name="ARVRInterfaceGDNative" inherits="ARVRInterface" category="Core" version="3.0-beta"> <brief_description> GDNative wrapper for an ARVR interface </brief_description> diff --git a/modules/gdnative/doc_classes/GDNative.xml b/modules/gdnative/doc_classes/GDNative.xml index 7a36d09aec..83953cef49 100644 --- a/modules/gdnative/doc_classes/GDNative.xml +++ b/modules/gdnative/doc_classes/GDNative.xml @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="UTF-8" ?> -<class name="GDNative" inherits="Reference" category="Core" version="3.0-alpha"> +<class name="GDNative" inherits="Reference" category="Core" version="3.0-beta"> <brief_description> </brief_description> <description> @@ -21,26 +21,12 @@ <description> </description> </method> - <method name="get_library"> - <return type="GDNativeLibrary"> - </return> - <description> - </description> - </method> <method name="initialize"> <return type="bool"> </return> <description> </description> </method> - <method name="set_library"> - <return type="void"> - </return> - <argument index="0" name="library" type="GDNativeLibrary"> - </argument> - <description> - </description> - </method> <method name="terminate"> <return type="bool"> </return> diff --git a/modules/gdnative/doc_classes/GDNativeLibrary.xml b/modules/gdnative/doc_classes/GDNativeLibrary.xml index e271665fd4..647d27929f 100644 --- a/modules/gdnative/doc_classes/GDNativeLibrary.xml +++ b/modules/gdnative/doc_classes/GDNativeLibrary.xml @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="UTF-8" ?> -<class name="GDNativeLibrary" inherits="Resource" category="Core" version="3.0-alpha"> +<class name="GDNativeLibrary" inherits="Resource" category="Core" version="3.0-beta"> <brief_description> </brief_description> <description> @@ -27,54 +27,6 @@ <description> </description> </method> - <method name="get_symbol_prefix" qualifiers="const"> - <return type="String"> - </return> - <description> - </description> - </method> - <method name="is_current_library_statically_linked" qualifiers="const"> - <return type="bool"> - </return> - <description> - </description> - </method> - <method name="is_singleton" qualifiers="const"> - <return type="bool"> - </return> - <description> - </description> - </method> - <method name="set_load_once"> - <return type="void"> - </return> - <argument index="0" name="load_once" type="bool"> - </argument> - <description> - </description> - </method> - <method name="set_singleton"> - <return type="void"> - </return> - <argument index="0" name="singleton" type="bool"> - </argument> - <description> - </description> - </method> - <method name="set_symbol_prefix"> - <return type="void"> - </return> - <argument index="0" name="symbol_prefix" type="String"> - </argument> - <description> - </description> - </method> - <method name="should_load_once" qualifiers="const"> - <return type="bool"> - </return> - <description> - </description> - </method> </methods> <members> <member name="load_once" type="bool" setter="set_load_once" getter="should_load_once"> diff --git a/modules/gdnative/doc_classes/NativeScript.xml b/modules/gdnative/doc_classes/NativeScript.xml index eb4e13f748..3f6025d02f 100644 --- a/modules/gdnative/doc_classes/NativeScript.xml +++ b/modules/gdnative/doc_classes/NativeScript.xml @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="UTF-8" ?> -<class name="NativeScript" inherits="Script" category="Core" version="3.0-alpha"> +<class name="NativeScript" inherits="Script" category="Core" version="3.0-beta"> <brief_description> </brief_description> <description> @@ -9,40 +9,12 @@ <demos> </demos> <methods> - <method name="get_class_name" qualifiers="const"> - <return type="String"> - </return> - <description> - </description> - </method> - <method name="get_library" qualifiers="const"> - <return type="GDNativeLibrary"> - </return> - <description> - </description> - </method> <method name="new" qualifiers="vararg"> <return type="Object"> </return> <description> </description> </method> - <method name="set_class_name"> - <return type="void"> - </return> - <argument index="0" name="class_name" type="String"> - </argument> - <description> - </description> - </method> - <method name="set_library"> - <return type="void"> - </return> - <argument index="0" name="library" type="GDNativeLibrary"> - </argument> - <description> - </description> - </method> </methods> <members> <member name="class_name" type="String" setter="set_class_name" getter="get_class_name"> diff --git a/modules/gdnative/doc_classes/PluginScript.xml b/modules/gdnative/doc_classes/PluginScript.xml index a5ab422d3c..1a2141247a 100644 --- a/modules/gdnative/doc_classes/PluginScript.xml +++ b/modules/gdnative/doc_classes/PluginScript.xml @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="UTF-8" ?> -<class name="PluginScript" inherits="Script" category="Core" version="3.0-alpha"> +<class name="PluginScript" inherits="Script" category="Core" version="3.0-beta"> <brief_description> </brief_description> <description> diff --git a/modules/gdnative/gdnative.cpp b/modules/gdnative/gdnative.cpp index de118043ca..9c0041cbe0 100644 --- a/modules/gdnative/gdnative.cpp +++ b/modules/gdnative/gdnative.cpp @@ -123,7 +123,13 @@ bool GDNative::initialize() { return false; } #ifdef IPHONE_ENABLED + // on iOS we use static linking String path = ""; +#elif defined(ANDROID_ENABLED) + // On Android dynamic libraries are located separately from resource assets, + // we should pass library name to dlopen(). The library name is flattened + // during export. + String path = lib_path.get_file(); #else String path = ProjectSettings::get_singleton()->globalize_path(lib_path); #endif @@ -138,7 +144,7 @@ bool GDNative::initialize() { } } - Error err = OS::get_singleton()->open_dynamic_library(path, native_handle); + Error err = OS::get_singleton()->open_dynamic_library(path, native_handle, true); if (err != OK) { return false; } diff --git a/modules/gdnative/gdnative.h b/modules/gdnative/gdnative.h index bb260bdd1b..993cd0ece7 100644 --- a/modules/gdnative/gdnative.h +++ b/modules/gdnative/gdnative.h @@ -106,8 +106,8 @@ struct GDNativeCallRegistry { return singleton; } - inline GDNativeCallRegistry() - : native_calls() {} + inline GDNativeCallRegistry() : + native_calls() {} Map<StringName, native_call_cb> native_calls; diff --git a/modules/gdnative/gdnative/basis.cpp b/modules/gdnative/gdnative/basis.cpp index 39ca754dc7..7a65996036 100644 --- a/modules/gdnative/gdnative/basis.cpp +++ b/modules/gdnative/gdnative/basis.cpp @@ -221,7 +221,7 @@ godot_basis GDAPI godot_basis_operator_add(const godot_basis *p_self, const godo return raw_dest; } -godot_basis GDAPI godot_basis_operator_substract(const godot_basis *p_self, const godot_basis *p_b) { +godot_basis GDAPI godot_basis_operator_subtract(const godot_basis *p_self, const godot_basis *p_b) { godot_basis raw_dest; Basis *dest = (Basis *)&raw_dest; const Basis *self = (const Basis *)p_self; diff --git a/modules/gdnative/gdnative/node_path.cpp b/modules/gdnative/gdnative/node_path.cpp index 2bd278e050..8dfe151f91 100644 --- a/modules/gdnative/gdnative/node_path.cpp +++ b/modules/gdnative/gdnative/node_path.cpp @@ -91,10 +91,10 @@ godot_string GDAPI godot_node_path_get_subname(const godot_node_path *p_self, co return dest; } -godot_string GDAPI godot_node_path_get_property(const godot_node_path *p_self) { +godot_string GDAPI godot_node_path_get_concatenated_subnames(const godot_node_path *p_self) { godot_string dest; const NodePath *self = (const NodePath *)p_self; - memnew_placement(&dest, String(self->get_property())); + memnew_placement(&dest, String(self->get_concatenated_subnames())); return dest; } diff --git a/modules/gdnative/gdnative/quat.cpp b/modules/gdnative/gdnative/quat.cpp index 2d012c069f..c308e5973d 100644 --- a/modules/gdnative/gdnative/quat.cpp +++ b/modules/gdnative/gdnative/quat.cpp @@ -181,7 +181,7 @@ godot_quat GDAPI godot_quat_operator_add(const godot_quat *p_self, const godot_q return raw_dest; } -godot_quat GDAPI godot_quat_operator_substract(const godot_quat *p_self, const godot_quat *p_b) { +godot_quat GDAPI godot_quat_operator_subtract(const godot_quat *p_self, const godot_quat *p_b) { godot_quat raw_dest; Quat *dest = (Quat *)&raw_dest; const Quat *self = (const Quat *)p_self; diff --git a/modules/gdnative/gdnative/vector2.cpp b/modules/gdnative/gdnative/vector2.cpp index 7a5b29e0c4..7be08929b1 100644 --- a/modules/gdnative/gdnative/vector2.cpp +++ b/modules/gdnative/gdnative/vector2.cpp @@ -207,7 +207,7 @@ godot_vector2 GDAPI godot_vector2_operator_add(const godot_vector2 *p_self, cons return raw_dest; } -godot_vector2 GDAPI godot_vector2_operator_substract(const godot_vector2 *p_self, const godot_vector2 *p_b) { +godot_vector2 GDAPI godot_vector2_operator_subtract(const godot_vector2 *p_self, const godot_vector2 *p_b) { godot_vector2 raw_dest; Vector2 *dest = (Vector2 *)&raw_dest; const Vector2 *self = (const Vector2 *)p_self; diff --git a/modules/gdnative/gdnative/vector3.cpp b/modules/gdnative/gdnative/vector3.cpp index 11ffb3320b..0027d236f2 100644 --- a/modules/gdnative/gdnative/vector3.cpp +++ b/modules/gdnative/gdnative/vector3.cpp @@ -224,7 +224,7 @@ godot_vector3 GDAPI godot_vector3_operator_add(const godot_vector3 *p_self, cons return raw_dest; } -godot_vector3 GDAPI godot_vector3_operator_substract(const godot_vector3 *p_self, const godot_vector3 *p_b) { +godot_vector3 GDAPI godot_vector3_operator_subtract(const godot_vector3 *p_self, const godot_vector3 *p_b) { godot_vector3 raw_dest; Vector3 *dest = (Vector3 *)&raw_dest; Vector3 *self = (Vector3 *)p_self; diff --git a/modules/gdnative/gdnative_api.json b/modules/gdnative/gdnative_api.json index 0438a196cf..31f3b0b77b 100644 --- a/modules/gdnative/gdnative_api.json +++ b/modules/gdnative/gdnative_api.json @@ -387,7 +387,7 @@ ] }, { - "name": "godot_vector2_operator_substract", + "name": "godot_vector2_operator_subtract", "return_type": "godot_vector2", "arguments": [ ["const godot_vector2 *", "p_self"], @@ -663,7 +663,7 @@ ] }, { - "name": "godot_quat_operator_substract", + "name": "godot_quat_operator_subtract", "return_type": "godot_quat", "arguments": [ ["const godot_quat *", "p_self"], @@ -907,7 +907,7 @@ ] }, { - "name": "godot_basis_operator_substract", + "name": "godot_basis_operator_subtract", "return_type": "godot_basis", "arguments": [ ["const godot_basis *", "p_self"], @@ -1142,7 +1142,7 @@ ] }, { - "name": "godot_vector3_operator_substract", + "name": "godot_vector3_operator_subtract", "return_type": "godot_vector3", "arguments": [ ["const godot_vector3 *", "p_self"], @@ -2918,7 +2918,7 @@ ] }, { - "name": "godot_node_path_get_property", + "name": "godot_node_path_get_concatenated_subnames", "return_type": "godot_string", "arguments": [ ["const godot_node_path *", "p_self"] diff --git a/modules/gdnative/include/gdnative/basis.h b/modules/gdnative/include/gdnative/basis.h index 49ca765a01..4898eab24c 100644 --- a/modules/gdnative/include/gdnative/basis.h +++ b/modules/gdnative/include/gdnative/basis.h @@ -111,7 +111,7 @@ godot_bool GDAPI godot_basis_operator_equal(const godot_basis *p_self, const god godot_basis GDAPI godot_basis_operator_add(const godot_basis *p_self, const godot_basis *p_b); -godot_basis GDAPI godot_basis_operator_substract(const godot_basis *p_self, const godot_basis *p_b); +godot_basis GDAPI godot_basis_operator_subtract(const godot_basis *p_self, const godot_basis *p_b); godot_basis GDAPI godot_basis_operator_multiply_vector(const godot_basis *p_self, const godot_basis *p_b); diff --git a/modules/gdnative/include/gdnative/gdnative.h b/modules/gdnative/include/gdnative/gdnative.h index 6e69d43469..f7f5606428 100644 --- a/modules/gdnative/include/gdnative/gdnative.h +++ b/modules/gdnative/include/gdnative/gdnative.h @@ -115,8 +115,6 @@ typedef enum { GODOT_ERR_HELP, ///< user requested help!! GODOT_ERR_BUG, ///< a bug in the software certainly happened, due to a double check failing or unexpected behavior. GODOT_ERR_PRINTER_ON_FIRE, /// the parallel port printer is engulfed in flames - GODOT_ERR_OMFG_THIS_IS_VERY_VERY_BAD, ///< shit happens, has never been used, though - GODOT_ERR_WTF = GODOT_ERR_OMFG_THIS_IS_VERY_VERY_BAD ///< short version of the above } godot_error; ////// bool diff --git a/modules/gdnative/include/gdnative/node_path.h b/modules/gdnative/include/gdnative/node_path.h index 42446175d8..b5a59fd325 100644 --- a/modules/gdnative/include/gdnative/node_path.h +++ b/modules/gdnative/include/gdnative/node_path.h @@ -73,7 +73,7 @@ godot_int GDAPI godot_node_path_get_subname_count(const godot_node_path *p_self) godot_string GDAPI godot_node_path_get_subname(const godot_node_path *p_self, const godot_int p_idx); -godot_string GDAPI godot_node_path_get_property(const godot_node_path *p_self); +godot_string GDAPI godot_node_path_get_concatenated_subnames(const godot_node_path *p_self); godot_bool GDAPI godot_node_path_is_empty(const godot_node_path *p_self); diff --git a/modules/gdnative/include/gdnative/quat.h b/modules/gdnative/include/gdnative/quat.h index acae6e3e90..2be9d8849d 100644 --- a/modules/gdnative/include/gdnative/quat.h +++ b/modules/gdnative/include/gdnative/quat.h @@ -98,7 +98,7 @@ godot_quat GDAPI godot_quat_operator_multiply(const godot_quat *p_self, const go godot_quat GDAPI godot_quat_operator_add(const godot_quat *p_self, const godot_quat *p_b); -godot_quat GDAPI godot_quat_operator_substract(const godot_quat *p_self, const godot_quat *p_b); +godot_quat GDAPI godot_quat_operator_subtract(const godot_quat *p_self, const godot_quat *p_b); godot_quat GDAPI godot_quat_operator_divide(const godot_quat *p_self, const godot_real p_b); diff --git a/modules/gdnative/include/gdnative/vector2.h b/modules/gdnative/include/gdnative/vector2.h index 07105abaf2..4d1117e3aa 100644 --- a/modules/gdnative/include/gdnative/vector2.h +++ b/modules/gdnative/include/gdnative/vector2.h @@ -106,7 +106,7 @@ godot_vector2 GDAPI godot_vector2_clamped(const godot_vector2 *p_self, const god godot_vector2 GDAPI godot_vector2_operator_add(const godot_vector2 *p_self, const godot_vector2 *p_b); -godot_vector2 GDAPI godot_vector2_operator_substract(const godot_vector2 *p_self, const godot_vector2 *p_b); +godot_vector2 GDAPI godot_vector2_operator_subtract(const godot_vector2 *p_self, const godot_vector2 *p_b); godot_vector2 GDAPI godot_vector2_operator_multiply_vector(const godot_vector2 *p_self, const godot_vector2 *p_b); diff --git a/modules/gdnative/include/gdnative/vector3.h b/modules/gdnative/include/gdnative/vector3.h index 3ed23778ec..135a13acc8 100644 --- a/modules/gdnative/include/gdnative/vector3.h +++ b/modules/gdnative/include/gdnative/vector3.h @@ -117,7 +117,7 @@ godot_vector3 GDAPI godot_vector3_reflect(const godot_vector3 *p_self, const god godot_vector3 GDAPI godot_vector3_operator_add(const godot_vector3 *p_self, const godot_vector3 *p_b); -godot_vector3 GDAPI godot_vector3_operator_substract(const godot_vector3 *p_self, const godot_vector3 *p_b); +godot_vector3 GDAPI godot_vector3_operator_subtract(const godot_vector3 *p_self, const godot_vector3 *p_b); godot_vector3 GDAPI godot_vector3_operator_multiply_vector(const godot_vector3 *p_self, const godot_vector3 *p_b); diff --git a/modules/gdnative/nativescript/api_generator.cpp b/modules/gdnative/nativescript/api_generator.cpp index f9d699fb59..653445c2db 100644 --- a/modules/gdnative/nativescript/api_generator.cpp +++ b/modules/gdnative/nativescript/api_generator.cpp @@ -468,8 +468,6 @@ static List<String> generate_c_api_json(const List<ClassAPI> &p_api) { return source; } -// - #endif /* diff --git a/modules/gdnative/nativescript/nativescript.cpp b/modules/gdnative/nativescript/nativescript.cpp index c2c7c27f25..965de062e3 100644 --- a/modules/gdnative/nativescript/nativescript.cpp +++ b/modules/gdnative/nativescript/nativescript.cpp @@ -437,11 +437,11 @@ NativeScript::~NativeScript() { #endif } -// -// -// ScriptInstance stuff -// -// + // + // + // ScriptInstance stuff + // + // #define GET_SCRIPT_DESC() script->get_script_desc() diff --git a/modules/gdnative/nativescript/nativescript.h b/modules/gdnative/nativescript/nativescript.h index f0f14e2f30..30fa400cb0 100644 --- a/modules/gdnative/nativescript/nativescript.h +++ b/modules/gdnative/nativescript/nativescript.h @@ -76,12 +76,12 @@ struct NativeScriptDesc { bool is_tool; - inline NativeScriptDesc() - : methods(), - properties(), - signals_(), - base(), - base_native_type() { + inline NativeScriptDesc() : + methods(), + properties(), + signals_(), + base(), + base_native_type() { zeromem(&create_func, sizeof(godot_instance_create_func)); zeromem(&destroy_func, sizeof(godot_instance_destroy_func)); } diff --git a/modules/gdnative/pluginscript/pluginscript_language.cpp b/modules/gdnative/pluginscript/pluginscript_language.cpp index 40feb5ae43..e358c2fb69 100644 --- a/modules/gdnative/pluginscript/pluginscript_language.cpp +++ b/modules/gdnative/pluginscript/pluginscript_language.cpp @@ -410,8 +410,8 @@ void PluginScriptLanguage::unlock() { #endif } -PluginScriptLanguage::PluginScriptLanguage(const godot_pluginscript_language_desc *desc) - : _desc(*desc) { +PluginScriptLanguage::PluginScriptLanguage(const godot_pluginscript_language_desc *desc) : + _desc(*desc) { _resource_loader = memnew(ResourceFormatLoaderPluginScript(this)); _resource_saver = memnew(ResourceFormatSaverPluginScript(this)); diff --git a/modules/gdnative/pluginscript/pluginscript_script.cpp b/modules/gdnative/pluginscript/pluginscript_script.cpp index 4169b07f63..0b71b3b10d 100644 --- a/modules/gdnative/pluginscript/pluginscript_script.cpp +++ b/modules/gdnative/pluginscript/pluginscript_script.cpp @@ -423,8 +423,11 @@ ScriptInstance::RPCMode PluginScript::get_rset_mode(const StringName &p_variable } } -PluginScript::PluginScript() - : _data(NULL), _tool(false), _valid(false), _script_list(this) { +PluginScript::PluginScript() : + _data(NULL), + _tool(false), + _valid(false), + _script_list(this) { } void PluginScript::init(PluginScriptLanguage *language) { diff --git a/modules/gdnative/register_types.cpp b/modules/gdnative/register_types.cpp index 34099bf528..1cb35ec006 100644 --- a/modules/gdnative/register_types.cpp +++ b/modules/gdnative/register_types.cpp @@ -99,20 +99,41 @@ static Set<String> get_gdnative_singletons(EditorFileSystemDirectory *p_dir) { } static void actual_discoverer_handler() { + EditorFileSystemDirectory *dir = EditorFileSystem::get_singleton()->get_filesystem(); Set<String> file_paths = get_gdnative_singletons(dir); + bool changed = false; + Array current_files; + if (ProjectSettings::get_singleton()->has_setting("gdnative/singletons")) { + current_files = ProjectSettings::get_singleton()->get("gdnative/singletons"); + } Array files; files.resize(file_paths.size()); int i = 0; for (Set<String>::Element *E = file_paths.front(); E; i++, E = E->next()) { + if (!current_files.has(E->get())) { + changed = true; + } files.set(i, E->get()); } - ProjectSettings::get_singleton()->set("gdnative/singletons", files); + // Check for removed files + if (!changed) { + for (int i = 0; i < current_files.size(); i++) { + if (!file_paths.has(current_files[i])) { + changed = true; + break; + } + } + } - ProjectSettings::get_singleton()->save(); + if (changed) { + + ProjectSettings::get_singleton()->set("gdnative/singletons", files); + ProjectSettings::get_singleton()->save(); + } } static GDNativeSingletonDiscover *discoverer = NULL; diff --git a/modules/gdscript/doc_classes/GDScript.xml b/modules/gdscript/doc_classes/GDScript.xml index 13d45aa520..cc617c5c67 100644 --- a/modules/gdscript/doc_classes/GDScript.xml +++ b/modules/gdscript/doc_classes/GDScript.xml @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="UTF-8" ?> -<class name="GDScript" inherits="Script" category="Core" version="3.0-alpha"> +<class name="GDScript" inherits="Script" category="Core" version="3.0-beta"> <brief_description> A script implemented in the GDScript programming language. </brief_description> diff --git a/modules/gdscript/doc_classes/GDScriptFunctionState.xml b/modules/gdscript/doc_classes/GDScriptFunctionState.xml index 2df4e7c217..465a4f438b 100644 --- a/modules/gdscript/doc_classes/GDScriptFunctionState.xml +++ b/modules/gdscript/doc_classes/GDScriptFunctionState.xml @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="UTF-8" ?> -<class name="GDScriptFunctionState" inherits="Reference" category="Core" version="3.0-alpha"> +<class name="GDScriptFunctionState" inherits="Reference" category="Core" version="3.0-beta"> <brief_description> State of a function call after yielding. </brief_description> diff --git a/modules/gdscript/doc_classes/GDScriptNativeClass.xml b/modules/gdscript/doc_classes/GDScriptNativeClass.xml index 4514a78469..948254e0ad 100644 --- a/modules/gdscript/doc_classes/GDScriptNativeClass.xml +++ b/modules/gdscript/doc_classes/GDScriptNativeClass.xml @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="UTF-8" ?> -<class name="GDScriptNativeClass" inherits="Reference" category="Core" version="3.0-alpha"> +<class name="GDScriptNativeClass" inherits="Reference" category="Core" version="3.0-beta"> <brief_description> </brief_description> <description> diff --git a/modules/gdscript/gdscript.cpp b/modules/gdscript/gdscript.cpp index 41a810ff00..b75f670906 100644 --- a/modules/gdscript/gdscript.cpp +++ b/modules/gdscript/gdscript.cpp @@ -738,7 +738,7 @@ Error GDScript::load_byte_code(const String &p_path) { Error err = fae->open_and_parse(fa, key, FileAccessEncrypted::MODE_READ); ERR_FAIL_COND_V(err, err); bytecode.resize(fae->get_len()); - fae->get_buffer(bytecode.ptr(), bytecode.size()); + fae->get_buffer(bytecode.ptrw(), bytecode.size()); memdelete(fae); } else { @@ -876,8 +876,8 @@ void GDScript::get_script_signal_list(List<MethodInfo> *r_signals) const { #endif } -GDScript::GDScript() - : script_list(this) { +GDScript::GDScript() : + script_list(this) { _static_ref = this; valid = false; @@ -1324,7 +1324,7 @@ void GDScriptLanguage::_add_global(const StringName &p_name, const Variant &p_va } globals[p_name] = global_array.size(); global_array.push_back(p_value); - _global_array = global_array.ptr(); + _global_array = global_array.ptrw(); } void GDScriptLanguage::add_global_constant(const StringName &p_variable, const Variant &p_value) { diff --git a/modules/gdscript/gdscript_compiler.cpp b/modules/gdscript/gdscript_compiler.cpp index 4cd6472b7f..f9385d7a11 100644 --- a/modules/gdscript/gdscript_compiler.cpp +++ b/modules/gdscript/gdscript_compiler.cpp @@ -806,8 +806,8 @@ int GDScriptCompiler::_parse_expression(CodeGen &codegen, const GDScriptParser:: ERR_FAIL_COND_V(on->arguments.size() != 2, -1); if (on->arguments[0]->type == GDScriptParser::Node::TYPE_OPERATOR && (static_cast<GDScriptParser::OperatorNode *>(on->arguments[0])->op == GDScriptParser::OperatorNode::OP_INDEX || static_cast<GDScriptParser::OperatorNode *>(on->arguments[0])->op == GDScriptParser::OperatorNode::OP_INDEX_NAMED)) { -//SET (chained) MODE!! + // SET (chained) MODE! #ifdef DEBUG_ENABLED if (static_cast<GDScriptParser::OperatorNode *>(on->arguments[0])->op == GDScriptParser::OperatorNode::OP_INDEX_NAMED) { const GDScriptParser::OperatorNode *inon = static_cast<GDScriptParser::OperatorNode *>(on->arguments[0]); diff --git a/modules/gdscript/gdscript_editor.cpp b/modules/gdscript/gdscript_editor.cpp index 5a76acea6e..adf6780278 100644 --- a/modules/gdscript/gdscript_editor.cpp +++ b/modules/gdscript/gdscript_editor.cpp @@ -29,11 +29,11 @@ /*************************************************************************/ #include "gdscript.h" +#include "core/engine.h" #include "editor/editor_settings.h" #include "gdscript_compiler.h" #include "global_constants.h" #include "os/file_access.h" -#include "core/engine.h" #ifdef TOOLS_ENABLED #include "editor/editor_file_system.h" @@ -791,7 +791,7 @@ static bool _guess_expression_type(GDScriptCompletionContext &context, const GDS } Variant::CallError ce; - Variant ret = mb->call(baseptr, argptr.ptr(), argptr.size(), ce); + Variant ret = mb->call(baseptr, (const Variant **)argptr.ptr(), argptr.size(), ce); if (ce.error == Variant::CallError::CALL_OK && ret.get_type() != Variant::NIL) { @@ -1795,8 +1795,8 @@ static void _find_type_arguments(GDScriptCompletionContext &context, const GDScr } } else { - //regular method + //regular method #if defined(DEBUG_METHODS_ENABLED) && defined(TOOLS_ENABLED) if (p_argidx < m->get_argument_count()) { PropertyInfo pi = m->get_argument_info(p_argidx); diff --git a/modules/gdscript/gdscript_function.cpp b/modules/gdscript/gdscript_function.cpp index 765a76fec4..ee23f0ea0f 100644 --- a/modules/gdscript/gdscript_function.cpp +++ b/modules/gdscript/gdscript_function.cpp @@ -250,7 +250,7 @@ Variant GDScriptFunction::call(GDScriptInstance *p_instance, const Variant **p_a #ifdef DEBUG_ENABLED -//GDScriptLanguage::get_singleton()->calls++; + //GDScriptLanguage::get_singleton()->calls++; #endif @@ -515,7 +515,7 @@ Variant GDScriptFunction::call(GDScriptInstance *p_instance, const Variant **p_a } else { v = "of type '" + _get_var_type(index) + "'"; } - err_text = "Invalid set index " + v + " (on base: '" + _get_var_type(dst) + "')."; + err_text = "Invalid set index " + v + " (on base: '" + _get_var_type(dst) + "') with value of type '" + _get_var_type(value) + "'"; OPCODE_BREAK; } #endif @@ -574,7 +574,7 @@ Variant GDScriptFunction::call(GDScriptInstance *p_instance, const Variant **p_a #ifdef DEBUG_ENABLED if (!valid) { String err_type; - err_text = "Invalid set index '" + String(*index) + "' (on base: '" + _get_var_type(dst) + "')."; + err_text = "Invalid set index '" + String(*index) + "' (on base: '" + _get_var_type(dst) + "') with value of type '" + _get_var_type(value) + "'."; OPCODE_BREAK; } #endif @@ -1432,8 +1432,8 @@ void GDScriptFunction::debug_get_stack_member_state(int p_line, List<Pair<String } } -GDScriptFunction::GDScriptFunction() - : function_list(this) { +GDScriptFunction::GDScriptFunction() : + function_list(this) { _stack_size = 0; _call_size = 0; diff --git a/modules/gdscript/gdscript_parser.cpp b/modules/gdscript/gdscript_parser.cpp index bee9ef1998..599f204184 100644 --- a/modules/gdscript/gdscript_parser.cpp +++ b/modules/gdscript/gdscript_parser.cpp @@ -2976,10 +2976,9 @@ void GDScriptParser::_parse_extends(ClassNode *p_class) { case GDScriptTokenizer::TK_IDENTIFIER: { - StringName identifier = tokenizer->get_token_identifier(); - p_class->extends_class.push_back(identifier); - } - break; + StringName identifier = tokenizer->get_token_identifier(); + p_class->extends_class.push_back(identifier); + } break; case GDScriptTokenizer::TK_PERIOD: break; @@ -3390,6 +3389,10 @@ void GDScriptParser::_parse_class(ClassNode *p_class) { _set_error("Can't export null type."); return; } + if (type == Variant::OBJECT) { + _set_error("Can't export raw object type."); + return; + } current_export.type = type; current_export.usage |= PROPERTY_USAGE_SCRIPT_VARIABLE; tokenizer->advance(); diff --git a/modules/gridmap/doc_classes/GridMap.xml b/modules/gridmap/doc_classes/GridMap.xml index ee8ecfff66..8c862b52e8 100644 --- a/modules/gridmap/doc_classes/GridMap.xml +++ b/modules/gridmap/doc_classes/GridMap.xml @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="UTF-8" ?> -<class name="GridMap" inherits="Spatial" category="Core" version="3.0-alpha"> +<class name="GridMap" inherits="Spatial" category="Core" version="3.0-beta"> <brief_description> Node for 3D tile-based maps. </brief_description> @@ -220,7 +220,7 @@ </method> </methods> <constants> - <constant name="INVALID_CELL_ITEM" value="-1" enum=""> + <constant name="INVALID_CELL_ITEM" value="-1"> Invalid cell item that can be used in [method set_cell_item] to clear cells (or represent an empty cell in [method get_cell_item]). </constant> </constants> diff --git a/modules/mobile_vr/doc_classes/MobileVRInterface.xml b/modules/mobile_vr/doc_classes/MobileVRInterface.xml index c99934aea9..5d3da0672e 100644 --- a/modules/mobile_vr/doc_classes/MobileVRInterface.xml +++ b/modules/mobile_vr/doc_classes/MobileVRInterface.xml @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="UTF-8" ?> -<class name="MobileVRInterface" inherits="ARVRInterface" category="Core" version="3.0-alpha"> +<class name="MobileVRInterface" inherits="ARVRInterface" category="Core" version="3.0-beta"> <brief_description> Generic mobile VR implementation </brief_description> @@ -12,102 +12,6 @@ <demos> </demos> <methods> - <method name="get_display_to_lens" qualifiers="const"> - <return type="float"> - </return> - <description> - Returns the distance between the display and the lens. - </description> - </method> - <method name="get_display_width" qualifiers="const"> - <return type="float"> - </return> - <description> - Return the width of the LCD screen of the device. - </description> - </method> - <method name="get_iod" qualifiers="const"> - <return type="float"> - </return> - <description> - Returns the interocular distance. - </description> - </method> - <method name="get_k1" qualifiers="const"> - <return type="float"> - </return> - <description> - Returns the k1 lens constant. - </description> - </method> - <method name="get_k2" qualifiers="const"> - <return type="float"> - </return> - <description> - Retuns the k2 lens constant - </description> - </method> - <method name="get_oversample" qualifiers="const"> - <return type="float"> - </return> - <description> - Returns the oversampling setting. - </description> - </method> - <method name="set_display_to_lens"> - <return type="void"> - </return> - <argument index="0" name="display_to_lens" type="float"> - </argument> - <description> - Sets the distance between display and the lens. - </description> - </method> - <method name="set_display_width"> - <return type="void"> - </return> - <argument index="0" name="display_width" type="float"> - </argument> - <description> - Sets the width of the LCD screen of the device. - </description> - </method> - <method name="set_iod"> - <return type="void"> - </return> - <argument index="0" name="iod" type="float"> - </argument> - <description> - Sets the interocular distance. - </description> - </method> - <method name="set_k1"> - <return type="void"> - </return> - <argument index="0" name="k" type="float"> - </argument> - <description> - Sets the k1 lens constant. - </description> - </method> - <method name="set_k2"> - <return type="void"> - </return> - <argument index="0" name="k" type="float"> - </argument> - <description> - Sets the k2 lens constant. - </description> - </method> - <method name="set_oversample"> - <return type="void"> - </return> - <argument index="0" name="oversample" type="float"> - </argument> - <description> - Sets the oversampling setting. - </description> - </method> </methods> <members> <member name="display_to_lens" type="float" setter="set_display_to_lens" getter="get_display_to_lens"> diff --git a/modules/mobile_vr/mobile_interface.cpp b/modules/mobile_vr/mobile_interface.cpp index 3a0b83d534..35253d5a77 100644 --- a/modules/mobile_vr/mobile_interface.cpp +++ b/modules/mobile_vr/mobile_interface.cpp @@ -461,6 +461,7 @@ MobileVRInterface::MobileVRInterface() { glGenBuffers(1, &half_screen_quad); glBindBuffer(GL_ARRAY_BUFFER, half_screen_quad); { + /* clang-format off */ const float qv[16] = { 0, -1, -1, -1, @@ -471,6 +472,7 @@ MobileVRInterface::MobileVRInterface() { 1, -1, 1, -1, }; + /* clang-format on */ glBufferData(GL_ARRAY_BUFFER, sizeof(float) * 16, qv, GL_STATIC_DRAW); } diff --git a/modules/mono/csharp_script.cpp b/modules/mono/csharp_script.cpp index dfa5e720ae..af5a0334c3 100644 --- a/modules/mono/csharp_script.cpp +++ b/modules/mono/csharp_script.cpp @@ -1332,7 +1332,7 @@ bool CSharpScript::_update_exports() { while (top && top != native) { const Vector<GDMonoField *> &fields = top->get_all_fields(); - for (int i = 0; i < fields.size(); i++) { + for (int i = fields.size() - 1; i >= 0; i--) { GDMonoField *field = fields[i]; if (field->is_static()) { @@ -1382,7 +1382,7 @@ bool CSharpScript::_update_exports() { PropertyInfo prop_info = PropertyInfo(type, name, hint, hint_string, PROPERTY_USAGE_DEFAULT | PROPERTY_USAGE_SCRIPT_VARIABLE); member_info[cname] = prop_info; - exported_members_cache.push_back(prop_info); + exported_members_cache.push_front(prop_info); if (tmp_object) { exported_members_defval_cache[cname] = GDMonoMarshal::mono_object_to_variant(field->get_value(tmp_object)); @@ -1885,8 +1885,8 @@ StringName CSharpScript::get_script_name() const { return name; } -CSharpScript::CSharpScript() - : script_list(this) { +CSharpScript::CSharpScript() : + script_list(this) { _clear(); diff --git a/modules/mono/doc_classes/@C#.xml b/modules/mono/doc_classes/@C#.xml index 5d27b32200..5fcbf36a2b 100644 --- a/modules/mono/doc_classes/@C#.xml +++ b/modules/mono/doc_classes/@C#.xml @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="UTF-8" ?> -<class name="@C#" category="Core" version="3.0-alpha"> +<class name="@C#" category="Core" version="3.0-beta"> <brief_description> </brief_description> <description> diff --git a/modules/mono/doc_classes/CSharpScript.xml b/modules/mono/doc_classes/CSharpScript.xml index ccc24b832c..853ef28731 100644 --- a/modules/mono/doc_classes/CSharpScript.xml +++ b/modules/mono/doc_classes/CSharpScript.xml @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="UTF-8" ?> -<class name="CSharpScript" inherits="Script" category="Core" version="3.0-alpha"> +<class name="CSharpScript" inherits="Script" category="Core" version="3.0-beta"> <brief_description> </brief_description> <description> diff --git a/modules/mono/doc_classes/GodotSharp.xml b/modules/mono/doc_classes/GodotSharp.xml index 9edbd18fc1..2696a0bb4b 100644 --- a/modules/mono/doc_classes/GodotSharp.xml +++ b/modules/mono/doc_classes/GodotSharp.xml @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="UTF-8" ?> -<class name="GodotSharp" inherits="Object" category="Core" version="3.0-alpha"> +<class name="GodotSharp" inherits="Object" category="Core" version="3.0-beta"> <brief_description> </brief_description> <description> diff --git a/modules/mono/editor/bindings_generator.cpp b/modules/mono/editor/bindings_generator.cpp index 59a2b73dbc..fbb9b2ed14 100644 --- a/modules/mono/editor/bindings_generator.cpp +++ b/modules/mono/editor/bindings_generator.cpp @@ -370,7 +370,7 @@ Error BindingsGenerator::generate_cs_core_project(const String &p_output_dir, bo Vector<uint8_t> data; data.resize(file_data.uncompressed_size); - Compression::decompress(data.ptr(), file_data.uncompressed_size, file_data.data, file_data.compressed_size, Compression::MODE_DEFLATE); + Compression::decompress(data.ptrw(), file_data.uncompressed_size, file_data.data, file_data.compressed_size, Compression::MODE_DEFLATE); if (file_name.get_basename() == BINDINGS_GLOBAL_SCOPE_CLASS) { // GD.cs must be formatted to include the generated global constants @@ -382,7 +382,7 @@ Error BindingsGenerator::generate_cs_core_project(const String &p_output_dir, bo CharString data_utf8 = data_str.utf8(); data.resize(data_utf8.length()); - copymem(data.ptr(), reinterpret_cast<const uint8_t *>(data_utf8.get_data()), data_utf8.length()); + copymem(data.ptrw(), reinterpret_cast<const uint8_t *>(data_utf8.get_data()), data_utf8.length()); } FileAccessRef file = FileAccess::open(output_file, FileAccess::WRITE); diff --git a/modules/mono/editor/csharp_project.cpp b/modules/mono/editor/csharp_project.cpp index bde5f0fd0b..9a1efb4423 100644 --- a/modules/mono/editor/csharp_project.cpp +++ b/modules/mono/editor/csharp_project.cpp @@ -117,4 +117,4 @@ void add_item(const String &p_project_path, const String &p_item_type, const Str ERR_FAIL(); } } -} // CSharpProject +} // namespace CSharpProject diff --git a/modules/mono/editor/csharp_project.h b/modules/mono/editor/csharp_project.h index 4832d2251e..44e8325a59 100644 --- a/modules/mono/editor/csharp_project.h +++ b/modules/mono/editor/csharp_project.h @@ -39,6 +39,6 @@ String generate_editor_api_project(const String &p_dir, const String &p_core_dll String generate_game_project(const String &p_dir, const String &p_name, const Vector<String> &p_files = Vector<String>()); void add_item(const String &p_project_path, const String &p_item_type, const String &p_include); -} +} // namespace CSharpProject #endif // CSHARP_PROJECT_H diff --git a/modules/mono/glue/cs_files/AABB.cs b/modules/mono/glue/cs_files/AABB.cs index 6ee3bbe53a..e6e12f7ba3 100644 --- a/modules/mono/glue/cs_files/AABB.cs +++ b/modules/mono/glue/cs_files/AABB.cs @@ -38,7 +38,7 @@ namespace Godot } } - public bool encloses(AABB with) + public bool Encloses(AABB with) { Vector3 src_min = position; Vector3 src_max = position + size; @@ -53,7 +53,7 @@ namespace Godot (src_max.z > dst_max.z)); } - public AABB expand(Vector3 to_point) + public AABB Expand(Vector3 to_point) { Vector3 begin = position; Vector3 end = position + size; @@ -75,12 +75,12 @@ namespace Godot return new AABB(begin, end - begin); } - public float get_area() + public float GetArea() { return size.x * size.y * size.z; } - public Vector3 get_endpoint(int idx) + public Vector3 GetEndpoint(int idx) { switch (idx) { @@ -105,7 +105,7 @@ namespace Godot } } - public Vector3 get_longest_axis() + public Vector3 GetLongestAxis() { Vector3 axis = new Vector3(1f, 0f, 0f); float max_size = size.x; @@ -125,7 +125,7 @@ namespace Godot return axis; } - public Vector3.Axis get_longest_axis_index() + public Vector3.Axis GetLongestAxisIndex() { Vector3.Axis axis = Vector3.Axis.X; float max_size = size.x; @@ -145,7 +145,7 @@ namespace Godot return axis; } - public float get_longest_axis_size() + public float GetLongestAxisSize() { float max_size = size.x; @@ -158,7 +158,7 @@ namespace Godot return max_size; } - public Vector3 get_shortest_axis() + public Vector3 GetShortestAxis() { Vector3 axis = new Vector3(1f, 0f, 0f); float max_size = size.x; @@ -178,7 +178,7 @@ namespace Godot return axis; } - public Vector3.Axis get_shortest_axis_index() + public Vector3.Axis GetShortestAxisIndex() { Vector3.Axis axis = Vector3.Axis.X; float max_size = size.x; @@ -198,7 +198,7 @@ namespace Godot return axis; } - public float get_shortest_axis_size() + public float GetShortestAxisSize() { float max_size = size.x; @@ -211,7 +211,7 @@ namespace Godot return max_size; } - public Vector3 get_support(Vector3 dir) + public Vector3 GetSupport(Vector3 dir) { Vector3 half_extents = size * 0.5f; Vector3 ofs = position + half_extents; @@ -222,7 +222,7 @@ namespace Godot (dir.z > 0f) ? -half_extents.z : half_extents.z); } - public AABB grow(float by) + public AABB Grow(float by) { AABB res = this; @@ -236,17 +236,17 @@ namespace Godot return res; } - public bool has_no_area() + public bool HasNoArea() { return size.x <= 0f || size.y <= 0f || size.z <= 0f; } - public bool has_no_surface() + public bool HasNoSurface() { return size.x <= 0f && size.y <= 0f && size.z <= 0f; } - public bool has_point(Vector3 point) + public bool HasPoint(Vector3 point) { if (point.x < position.x) return false; @@ -264,7 +264,7 @@ namespace Godot return true; } - public AABB intersection(AABB with) + public AABB Intersection(AABB with) { Vector3 src_min = position; Vector3 src_max = position + size; @@ -306,7 +306,7 @@ namespace Godot return new AABB(min, max - min); } - public bool intersects(AABB with) + public bool Intersects(AABB with) { if (position.x >= (with.position.x + with.size.x)) return false; @@ -324,7 +324,7 @@ namespace Godot return true; } - public bool intersects_plane(Plane plane) + public bool IntersectsPlane(Plane plane) { Vector3[] points = { @@ -343,7 +343,7 @@ namespace Godot for (int i = 0; i < 8; i++) { - if (plane.distance_to(points[i]) > 0) + if (plane.DistanceTo(points[i]) > 0) over = true; else under = true; @@ -352,7 +352,7 @@ namespace Godot return under && over; } - public bool intersects_segment(Vector3 from, Vector3 to) + public bool IntersectsSegment(Vector3 from, Vector3 to) { float min = 0f; float max = 1f; @@ -398,7 +398,7 @@ namespace Godot return true; } - public AABB merge(AABB with) + public AABB Merge(AABB with) { Vector3 beg_1 = position; Vector3 beg_2 = with.position; diff --git a/modules/mono/glue/cs_files/Basis.cs b/modules/mono/glue/cs_files/Basis.cs index c50e783349..ea92b1641b 100644 --- a/modules/mono/glue/cs_files/Basis.cs +++ b/modules/mono/glue/cs_files/Basis.cs @@ -56,9 +56,9 @@ namespace Godot { return new Vector3 ( - new Vector3(this[0, 0], this[1, 0], this[2, 0]).length(), - new Vector3(this[0, 1], this[1, 1], this[2, 1]).length(), - new Vector3(this[0, 2], this[1, 2], this[2, 2]).length() + new Vector3(this[0, 0], this[1, 0], this[2, 0]).Length(), + new Vector3(this[0, 1], this[1, 1], this[2, 1]).Length(), + new Vector3(this[0, 2], this[1, 2], this[2, 2]).Length() ); } } @@ -133,7 +133,7 @@ namespace Godot } } - internal static Basis create_from_axes(Vector3 xAxis, Vector3 yAxis, Vector3 zAxis) + internal static Basis CreateFromAxes(Vector3 xAxis, Vector3 yAxis, Vector3 zAxis) { return new Basis ( @@ -143,21 +143,21 @@ namespace Godot ); } - public float determinant() + public float Determinant() { return this[0, 0] * (this[1, 1] * this[2, 2] - this[2, 1] * this[1, 2]) - this[1, 0] * (this[0, 1] * this[2, 2] - this[2, 1] * this[0, 2]) + this[2, 0] * (this[0, 1] * this[1, 2] - this[1, 1] * this[0, 2]); } - public Vector3 get_axis(int axis) + public Vector3 GetAxis(int axis) { return new Vector3(this[0, axis], this[1, axis], this[2, axis]); } - public Vector3 get_euler() + public Vector3 GetEuler() { - Basis m = this.orthonormalized(); + Basis m = this.Orthonormalized(); Vector3 euler; euler.z = 0.0f; @@ -169,26 +169,26 @@ namespace Godot { if (mxy > -1.0f) { - euler.x = Mathf.asin(-mxy); - euler.y = Mathf.atan2(m.x[2], m.z[2]); - euler.z = Mathf.atan2(m.y[0], m.y[1]); + euler.x = Mathf.Asin(-mxy); + euler.y = Mathf.Atan2(m.x[2], m.z[2]); + euler.z = Mathf.Atan2(m.y[0], m.y[1]); } else { euler.x = Mathf.PI * 0.5f; - euler.y = -Mathf.atan2(-m.x[1], m.x[0]); + euler.y = -Mathf.Atan2(-m.x[1], m.x[0]); } } else { euler.x = -Mathf.PI * 0.5f; - euler.y = -Mathf.atan2(m.x[1], m.x[0]); + euler.y = -Mathf.Atan2(m.x[1], m.x[0]); } return euler; } - public int get_orthogonal_index() + public int GetOrthogonalIndex() { Basis orth = this; @@ -218,7 +218,7 @@ namespace Godot return 0; } - public Basis inverse() + public Basis Inverse() { Basis inv = this; @@ -259,27 +259,27 @@ namespace Godot return inv; } - public Basis orthonormalized() + public Basis Orthonormalized() { - Vector3 xAxis = get_axis(0); - Vector3 yAxis = get_axis(1); - Vector3 zAxis = get_axis(2); + Vector3 xAxis = GetAxis(0); + Vector3 yAxis = GetAxis(1); + Vector3 zAxis = GetAxis(2); - xAxis.normalize(); - yAxis = (yAxis - xAxis * (xAxis.dot(yAxis))); - yAxis.normalize(); - zAxis = (zAxis - xAxis * (xAxis.dot(zAxis)) - yAxis * (yAxis.dot(zAxis))); - zAxis.normalize(); + xAxis.Normalize(); + yAxis = (yAxis - xAxis * (xAxis.Dot(yAxis))); + yAxis.Normalize(); + zAxis = (zAxis - xAxis * (xAxis.Dot(zAxis)) - yAxis * (yAxis.Dot(zAxis))); + zAxis.Normalize(); - return Basis.create_from_axes(xAxis, yAxis, zAxis); + return Basis.CreateFromAxes(xAxis, yAxis, zAxis); } - public Basis rotated(Vector3 axis, float phi) + public Basis Rotated(Vector3 axis, float phi) { return new Basis(axis, phi) * this; } - public Basis scaled(Vector3 scale) + public Basis Scaled(Vector3 scale) { Basis m = this; @@ -296,22 +296,22 @@ namespace Godot return m; } - public float tdotx(Vector3 with) + public float Tdotx(Vector3 with) { return this[0, 0] * with[0] + this[1, 0] * with[1] + this[2, 0] * with[2]; } - public float tdoty(Vector3 with) + public float Tdoty(Vector3 with) { return this[0, 1] * with[0] + this[1, 1] * with[1] + this[2, 1] * with[2]; } - public float tdotz(Vector3 with) + public float Tdotz(Vector3 with) { return this[0, 2] * with[0] + this[1, 2] * with[1] + this[2, 2] * with[2]; } - public Basis transposed() + public Basis Transposed() { Basis tr = this; @@ -330,17 +330,17 @@ namespace Godot return tr; } - public Vector3 xform(Vector3 v) + public Vector3 Xform(Vector3 v) { return new Vector3 ( - this[0].dot(v), - this[1].dot(v), - this[2].dot(v) + this[0].Dot(v), + this[1].Dot(v), + this[2].Dot(v) ); } - public Vector3 xform_inv(Vector3 v) + public Vector3 XformInv(Vector3 v) { return new Vector3 ( @@ -354,7 +354,7 @@ namespace Godot float trace = x[0] + y[1] + z[2]; if (trace > 0.0f) { - float s = Mathf.sqrt(trace + 1.0f) * 2f; + float s = Mathf.Sqrt(trace + 1.0f) * 2f; float inv_s = 1f / s; return new Quat( (z[1] - y[2]) * inv_s, @@ -363,7 +363,7 @@ namespace Godot s * 0.25f ); } else if (x[0] > y[1] && x[0] > z[2]) { - float s = Mathf.sqrt(x[0] - y[1] - z[2] + 1.0f) * 2f; + float s = Mathf.Sqrt(x[0] - y[1] - z[2] + 1.0f) * 2f; float inv_s = 1f / s; return new Quat( s * 0.25f, @@ -372,7 +372,7 @@ namespace Godot (z[1] - y[2]) * inv_s ); } else if (y[1] > z[2]) { - float s = Mathf.sqrt(-x[0] + y[1] - z[2] + 1.0f) * 2f; + float s = Mathf.Sqrt(-x[0] + y[1] - z[2] + 1.0f) * 2f; float inv_s = 1f / s; return new Quat( (x[1] + y[0]) * inv_s, @@ -381,7 +381,7 @@ namespace Godot (x[2] - z[0]) * inv_s ); } else { - float s = Mathf.sqrt(-x[0] - y[1] + z[2] + 1.0f) * 2f; + float s = Mathf.Sqrt(-x[0] - y[1] + z[2] + 1.0f) * 2f; float inv_s = 1f / s; return new Quat( (x[2] + z[0]) * inv_s, @@ -394,7 +394,7 @@ namespace Godot public Basis(Quat quat) { - float s = 2.0f / quat.length_squared(); + float s = 2.0f / quat.LengthSquared(); float xs = quat.x * s; float ys = quat.y * s; @@ -418,8 +418,8 @@ namespace Godot { Vector3 axis_sq = new Vector3(axis.x * axis.x, axis.y * axis.y, axis.z * axis.z); - float cosine = Mathf.cos(phi); - float sine = Mathf.sin(phi); + float cosine = Mathf.Cos(phi); + float sine = Mathf.Sin(phi); this.x = new Vector3 ( @@ -461,9 +461,9 @@ namespace Godot { return new Basis ( - right.tdotx(left[0]), right.tdoty(left[0]), right.tdotz(left[0]), - right.tdotx(left[1]), right.tdoty(left[1]), right.tdotz(left[1]), - right.tdotx(left[2]), right.tdoty(left[2]), right.tdotz(left[2]) + right.Tdotx(left[0]), right.Tdoty(left[0]), right.Tdotz(left[0]), + right.Tdotx(left[1]), right.Tdoty(left[1]), right.Tdotz(left[1]), + right.Tdotx(left[2]), right.Tdoty(left[2]), right.Tdotz(left[2]) ); } diff --git a/modules/mono/glue/cs_files/Color.cs b/modules/mono/glue/cs_files/Color.cs index 0a00f83d47..db0e1fb744 100644 --- a/modules/mono/glue/cs_files/Color.cs +++ b/modules/mono/glue/cs_files/Color.cs @@ -45,8 +45,8 @@ namespace Godot { get { - float max = Mathf.max(r, Mathf.max(g, b)); - float min = Mathf.min(r, Mathf.min(g, b)); + float max = Mathf.Max(r, Mathf.Max(g, b)); + float min = Mathf.Min(r, Mathf.Min(g, b)); float delta = max - min; @@ -71,7 +71,7 @@ namespace Godot } set { - this = from_hsv(value, s, v); + this = FromHsv(value, s, v); } } @@ -79,8 +79,8 @@ namespace Godot { get { - float max = Mathf.max(r, Mathf.max(g, b)); - float min = Mathf.min(r, Mathf.min(g, b)); + float max = Mathf.Max(r, Mathf.Max(g, b)); + float min = Mathf.Min(r, Mathf.Min(g, b)); float delta = max - min; @@ -88,7 +88,7 @@ namespace Godot } set { - this = from_hsv(h, value, v); + this = FromHsv(h, value, v); } } @@ -96,11 +96,11 @@ namespace Godot { get { - return Mathf.max(r, Mathf.max(g, b)); + return Mathf.Max(r, Mathf.Max(g, b)); } set { - this = from_hsv(h, s, value); + this = FromHsv(h, s, value); } } @@ -154,10 +154,10 @@ namespace Godot } } - public static void to_hsv(Color color, out float hue, out float saturation, out float value) + public static void ToHsv(Color color, out float hue, out float saturation, out float value) { - int max = Mathf.max(color.r8, Mathf.max(color.g8, color.b8)); - int min = Mathf.min(color.r8, Mathf.min(color.g8, color.b8)); + int max = Mathf.Max(color.r8, Mathf.Max(color.g8, color.b8)); + int min = Mathf.Min(color.r8, Mathf.Min(color.g8, color.b8)); float delta = max - min; @@ -184,7 +184,7 @@ namespace Godot value = max / 255f; } - public static Color from_hsv(float hue, float saturation, float value, float alpha = 1.0f) + public static Color FromHsv(float hue, float saturation, float value, float alpha = 1.0f) { if (saturation == 0) { @@ -221,7 +221,7 @@ namespace Godot } } - public Color blend(Color over) + public Color Blend(Color over) { Color res; @@ -242,7 +242,7 @@ namespace Godot return res; } - public Color contrasted() + public Color Contrasted() { return new Color( (r + 0.5f) % 1.0f, @@ -251,12 +251,12 @@ namespace Godot ); } - public float gray() + public float Gray() { return (r + g + b) / 3.0f; } - public Color inverted() + public Color Inverted() { return new Color( 1.0f - r, @@ -265,7 +265,7 @@ namespace Godot ); } - public Color linear_interpolate(Color b, float t) + public Color LinearInterpolate(Color b, float t) { Color res = this; @@ -277,7 +277,7 @@ namespace Godot return res; } - public int to_32() + public int To32() { int c = (byte)(a * 255); c <<= 8; @@ -290,7 +290,7 @@ namespace Godot return c; } - public int to_ARGB32() + public int ToArgb32() { int c = (byte)(a * 255); c <<= 8; @@ -303,7 +303,7 @@ namespace Godot return c; } - public string to_html(bool include_alpha = true) + public string ToHtml(bool include_alpha = true) { String txt = string.Empty; @@ -375,7 +375,7 @@ namespace Godot private String _to_hex(float val) { - int v = (int)Mathf.clamp(val * 255.0f, 0, 255); + int v = (int)Mathf.Clamp(val * 255.0f, 0, 255); string ret = string.Empty; @@ -396,7 +396,7 @@ namespace Godot return ret; } - internal static bool html_is_valid(string color) + internal static bool HtmlIsValid(string color) { if (color.Length == 0) return false; diff --git a/modules/mono/glue/cs_files/Error.cs b/modules/mono/glue/cs_files/Error.cs index 3f4a92603d..dee4b88f74 100644 --- a/modules/mono/glue/cs_files/Error.cs +++ b/modules/mono/glue/cs_files/Error.cs @@ -42,7 +42,6 @@ namespace Godot ERR_CYCLIC_LINK = 40, ERR_BUSY = 44, ERR_HELP = 46, - ERR_BUG = 47, - ERR_WTF = 49 + ERR_BUG = 47 } } diff --git a/modules/mono/glue/cs_files/GD.cs b/modules/mono/glue/cs_files/GD.cs index 40a42d23b4..99fc289161 100644 --- a/modules/mono/glue/cs_files/GD.cs +++ b/modules/mono/glue/cs_files/GD.cs @@ -6,32 +6,32 @@ namespace Godot { /*{GodotGlobalConstants}*/ - public static object bytes2var(byte[] bytes) + public static object Bytes2Var(byte[] bytes) { return NativeCalls.godot_icall_Godot_bytes2var(bytes); } - public static object convert(object what, int type) + public static object Convert(object what, int type) { return NativeCalls.godot_icall_Godot_convert(what, type); } - public static float db2linear(float db) + public static float Db2Linear(float db) { return (float)Math.Exp(db * 0.11512925464970228420089957273422); } - public static float dectime(float value, float amount, float step) + public static float Dectime(float value, float amount, float step) { float sgn = value < 0 ? -1.0f : 1.0f; - float val = Mathf.abs(value); + float val = Mathf.Abs(value); val -= amount * step; if (val < 0.0f) val = 0.0f; return val * sgn; } - public static FuncRef funcref(Object instance, string funcname) + public static FuncRef Funcref(Object instance, string funcname) { var ret = new FuncRef(); ret.SetInstance(instance); @@ -39,57 +39,57 @@ namespace Godot return ret; } - public static int hash(object var) + public static int Hash(object var) { return NativeCalls.godot_icall_Godot_hash(var); } - public static Object instance_from_id(int instance_id) + public static Object InstanceFromId(int instanceId) { - return NativeCalls.godot_icall_Godot_instance_from_id(instance_id); + return NativeCalls.godot_icall_Godot_instance_from_id(instanceId); } - public static double linear2db(double linear) + public static double Linear2Db(double linear) { return Math.Log(linear) * 8.6858896380650365530225783783321; } - public static Resource load(string path) + public static Resource Load(string path) { return ResourceLoader.Load(path); } - public static void print(params object[] what) + public static void Print(params object[] what) { NativeCalls.godot_icall_Godot_print(what); } - public static void print_stack() + public static void PrintStack() { - print(System.Environment.StackTrace); + Print(System.Environment.StackTrace); } - public static void printerr(params object[] what) + public static void Printerr(params object[] what) { NativeCalls.godot_icall_Godot_printerr(what); } - public static void printraw(params object[] what) + public static void Printraw(params object[] what) { NativeCalls.godot_icall_Godot_printraw(what); } - public static void prints(params object[] what) + public static void Prints(params object[] what) { NativeCalls.godot_icall_Godot_prints(what); } - public static void printt(params object[] what) + public static void Printt(params object[] what) { NativeCalls.godot_icall_Godot_printt(what); } - public static int[] range(int length) + public static int[] Range(int length) { int[] ret = new int[length]; @@ -101,7 +101,7 @@ namespace Godot return ret; } - public static int[] range(int from, int to) + public static int[] Range(int from, int to) { if (to < from) return new int[0]; @@ -116,7 +116,7 @@ namespace Godot return ret; } - public static int[] range(int from, int to, int increment) + public static int[] Range(int from, int to, int increment) { if (to < from && increment > 0) return new int[0]; @@ -153,37 +153,37 @@ namespace Godot return ret; } - public static void seed(int seed) + public static void Seed(int seed) { NativeCalls.godot_icall_Godot_seed(seed); } - public static string str(params object[] what) + public static string Str(params object[] what) { return NativeCalls.godot_icall_Godot_str(what); } - public static object str2var(string str) + public static object Str2Var(string str) { return NativeCalls.godot_icall_Godot_str2var(str); } - public static bool type_exists(string type) + public static bool TypeExists(string type) { return NativeCalls.godot_icall_Godot_type_exists(type); } - public static byte[] var2bytes(object var) + public static byte[] Var2Bytes(object var) { return NativeCalls.godot_icall_Godot_var2bytes(var); } - public static string var2str(object var) + public static string Var2Str(object var) { return NativeCalls.godot_icall_Godot_var2str(var); } - public static WeakRef weakref(Object obj) + public static WeakRef Weakref(Object obj) { return NativeCalls.godot_icall_Godot_weakref(Object.GetPtr(obj)); } diff --git a/modules/mono/glue/cs_files/Mathf.cs b/modules/mono/glue/cs_files/Mathf.cs index 37e6e5bbe3..6951ace4fc 100644 --- a/modules/mono/glue/cs_files/Mathf.cs +++ b/modules/mono/glue/cs_files/Mathf.cs @@ -10,42 +10,42 @@ namespace Godot private const float Deg2RadConst = 0.0174532924f; private const float Rad2DegConst = 57.29578f; - public static float abs(float s) + public static float Abs(float s) { return Math.Abs(s); } - public static float acos(float s) + public static float Acos(float s) { return (float)Math.Acos(s); } - public static float asin(float s) + public static float Asin(float s) { return (float)Math.Asin(s); } - public static float atan(float s) + public static float Atan(float s) { return (float)Math.Atan(s); } - public static float atan2(float x, float y) + public static float Atan2(float x, float y) { return (float)Math.Atan2(x, y); } - public static Vector2 cartesian2polar(float x, float y) + public static Vector2 Cartesian2Polar(float x, float y) { - return new Vector2(sqrt(x * x + y * y), atan2(y, x)); + return new Vector2(Sqrt(x * x + y * y), Atan2(y, x)); } - public static float ceil(float s) + public static float Ceil(float s) { return (float)Math.Ceiling(s); } - public static float clamp(float val, float min, float max) + public static float Clamp(float val, float min, float max) { if (val < min) { @@ -59,32 +59,32 @@ namespace Godot return val; } - public static float cos(float s) + public static float Cos(float s) { return (float)Math.Cos(s); } - public static float cosh(float s) + public static float Cosh(float s) { return (float)Math.Cosh(s); } - public static int decimals(float step) + public static int Decimals(float step) { - return decimals(step); + return Decimals(step); } - public static int decimals(decimal step) + public static int Decimals(decimal step) { return BitConverter.GetBytes(decimal.GetBits(step)[3])[2]; } - public static float deg2rad(float deg) + public static float Deg2Rad(float deg) { return deg * Deg2RadConst; } - public static float ease(float s, float curve) + public static float Ease(float s, float curve) { if (s < 0f) { @@ -99,35 +99,35 @@ namespace Godot { if (curve < 1.0f) { - return 1.0f - pow(1.0f - s, 1.0f / curve); + return 1.0f - Pow(1.0f - s, 1.0f / curve); } - return pow(s, curve); + return Pow(s, curve); } else if (curve < 0f) { if (s < 0.5f) { - return pow(s * 2.0f, -curve) * 0.5f; + return Pow(s * 2.0f, -curve) * 0.5f; } - return (1.0f - pow(1.0f - (s - 0.5f) * 2.0f, -curve)) * 0.5f + 0.5f; + return (1.0f - Pow(1.0f - (s - 0.5f) * 2.0f, -curve)) * 0.5f + 0.5f; } return 0f; } - public static float exp(float s) + public static float Exp(float s) { return (float)Math.Exp(s); } - public static float floor(float s) + public static float Floor(float s) { return (float)Math.Floor(s); } - public static float fposmod(float x, float y) + public static float Fposmod(float x, float y) { if (x >= 0f) { @@ -139,37 +139,37 @@ namespace Godot } } - public static float lerp(float from, float to, float weight) + public static float Lerp(float from, float to, float weight) { - return from + (to - from) * clamp(weight, 0f, 1f); + return from + (to - from) * Clamp(weight, 0f, 1f); } - public static float log(float s) + public static float Log(float s) { return (float)Math.Log(s); } - public static int max(int a, int b) + public static int Max(int a, int b) { return (a > b) ? a : b; } - public static float max(float a, float b) + public static float Max(float a, float b) { return (a > b) ? a : b; } - public static int min(int a, int b) + public static int Min(int a, int b) { return (a < b) ? a : b; } - public static float min(float a, float b) + public static float Min(float a, float b) { return (a < b) ? a : b; } - public static int nearest_po2(int val) + public static int NearestPo2(int val) { val--; val |= val >> 1; @@ -181,62 +181,62 @@ namespace Godot return val; } - public static Vector2 polar2cartesian(float r, float th) + public static Vector2 Polar2Cartesian(float r, float th) { - return new Vector2(r * cos(th), r * sin(th)); + return new Vector2(r * Cos(th), r * Sin(th)); } - public static float pow(float x, float y) + public static float Pow(float x, float y) { return (float)Math.Pow(x, y); } - public static float rad2deg(float rad) + public static float Rad2Deg(float rad) { return rad * Rad2DegConst; } - public static float round(float s) + public static float Round(float s) { return (float)Math.Round(s); } - public static float sign(float s) + public static float Sign(float s) { return (s < 0f) ? -1f : 1f; } - public static float sin(float s) + public static float Sin(float s) { return (float)Math.Sin(s); } - public static float sinh(float s) + public static float Sinh(float s) { return (float)Math.Sinh(s); } - public static float sqrt(float s) + public static float Sqrt(float s) { return (float)Math.Sqrt(s); } - public static float stepify(float s, float step) + public static float Stepify(float s, float step) { if (step != 0f) { - s = floor(s / step + 0.5f) * step; + s = Floor(s / step + 0.5f) * step; } return s; } - public static float tan(float s) + public static float Tan(float s) { return (float)Math.Tan(s); } - public static float tanh(float s) + public static float Tanh(float s) { return (float)Math.Tanh(s); } diff --git a/modules/mono/glue/cs_files/Plane.cs b/modules/mono/glue/cs_files/Plane.cs index 37f70aca1e..6365e71826 100644 --- a/modules/mono/glue/cs_files/Plane.cs +++ b/modules/mono/glue/cs_files/Plane.cs @@ -52,44 +52,44 @@ namespace Godot } } - public float distance_to(Vector3 point) + public float DistanceTo(Vector3 point) { - return normal.dot(point) - d; + return normal.Dot(point) - d; } - public Vector3 get_any_point() + public Vector3 GetAnyPoint() { return normal * d; } - public bool has_point(Vector3 point, float epsilon = Mathf.Epsilon) + public bool HasPoint(Vector3 point, float epsilon = Mathf.Epsilon) { - float dist = normal.dot(point) - d; - return Mathf.abs(dist) <= epsilon; + float dist = normal.Dot(point) - d; + return Mathf.Abs(dist) <= epsilon; } - public Vector3 intersect_3(Plane b, Plane c) + public Vector3 Intersect3(Plane b, Plane c) { - float denom = normal.cross(b.normal).dot(c.normal); + float denom = normal.Cross(b.normal).Dot(c.normal); - if (Mathf.abs(denom) <= Mathf.Epsilon) + if (Mathf.Abs(denom) <= Mathf.Epsilon) return new Vector3(); - Vector3 result = (b.normal.cross(c.normal) * this.d) + - (c.normal.cross(normal) * b.d) + - (normal.cross(b.normal) * c.d); + Vector3 result = (b.normal.Cross(c.normal) * this.d) + + (c.normal.Cross(normal) * b.d) + + (normal.Cross(b.normal) * c.d); return result / denom; } - public Vector3 intersect_ray(Vector3 from, Vector3 dir) + public Vector3 IntersectRay(Vector3 from, Vector3 dir) { - float den = normal.dot(dir); + float den = normal.Dot(dir); - if (Mathf.abs(den) <= Mathf.Epsilon) + if (Mathf.Abs(den) <= Mathf.Epsilon) return new Vector3(); - float dist = (normal.dot(from) - d) / den; + float dist = (normal.Dot(from) - d) / den; // This is a ray, before the emiting pos (from) does not exist if (dist > Mathf.Epsilon) @@ -98,15 +98,15 @@ namespace Godot return from + dir * -dist; } - public Vector3 intersect_segment(Vector3 begin, Vector3 end) + public Vector3 IntersectSegment(Vector3 begin, Vector3 end) { Vector3 segment = begin - end; - float den = normal.dot(segment); + float den = normal.Dot(segment); - if (Mathf.abs(den) <= Mathf.Epsilon) + if (Mathf.Abs(den) <= Mathf.Epsilon) return new Vector3(); - float dist = (normal.dot(begin) - d) / den; + float dist = (normal.Dot(begin) - d) / den; if (dist < -Mathf.Epsilon || dist > (1.0f + Mathf.Epsilon)) return new Vector3(); @@ -114,14 +114,14 @@ namespace Godot return begin + segment * -dist; } - public bool is_point_over(Vector3 point) + public bool IsPointOver(Vector3 point) { - return normal.dot(point) > d; + return normal.Dot(point) > d; } - public Plane normalized() + public Plane Normalized() { - float len = normal.length(); + float len = normal.Length(); if (len == 0) return new Plane(0, 0, 0, 0); @@ -129,9 +129,9 @@ namespace Godot return new Plane(normal / len, d / len); } - public Vector3 project(Vector3 point) + public Vector3 Project(Vector3 point) { - return point - normal * distance_to(point); + return point - normal * DistanceTo(point); } public Plane(float a, float b, float c, float d) @@ -148,9 +148,9 @@ namespace Godot public Plane(Vector3 v1, Vector3 v2, Vector3 v3) { - normal = (v1 - v3).cross(v1 - v2); - normal.normalize(); - d = normal.dot(v1); + normal = (v1 - v3).Cross(v1 - v2); + normal.Normalize(); + d = normal.Dot(v1); } public static Plane operator -(Plane plane) diff --git a/modules/mono/glue/cs_files/Quat.cs b/modules/mono/glue/cs_files/Quat.cs index 9b4b7fb297..c0ac41c5d7 100644 --- a/modules/mono/glue/cs_files/Quat.cs +++ b/modules/mono/glue/cs_files/Quat.cs @@ -58,40 +58,40 @@ namespace Godot } } - public Quat cubic_slerp(Quat b, Quat preA, Quat postB, float t) + public Quat CubicSlerp(Quat b, Quat preA, Quat postB, float t) { float t2 = (1.0f - t) * t * 2f; - Quat sp = slerp(b, t); - Quat sq = preA.slerpni(postB, t); - return sp.slerpni(sq, t2); + Quat sp = Slerp(b, t); + Quat sq = preA.Slerpni(postB, t); + return sp.Slerpni(sq, t2); } - public float dot(Quat b) + public float Dot(Quat b) { return x * b.x + y * b.y + z * b.z + w * b.w; } - public Quat inverse() + public Quat Inverse() { return new Quat(-x, -y, -z, w); } - public float length() + public float Length() { - return Mathf.sqrt(length_squared()); + return Mathf.Sqrt(LengthSquared()); } - public float length_squared() + public float LengthSquared() { - return dot(this); + return Dot(this); } - public Quat normalized() + public Quat Normalized() { - return this / length(); + return this / Length(); } - public void set(float x, float y, float z, float w) + public void Set(float x, float y, float z, float w) { this.x = x; this.y = y; @@ -99,7 +99,7 @@ namespace Godot this.w = w; } - public Quat slerp(Quat b, float t) + public Quat Slerp(Quat b, float t) { // Calculate cosine float cosom = x * b.x + y * b.y + z * b.z + w * b.w; @@ -128,10 +128,10 @@ namespace Godot if ((1.0 - cosom) > Mathf.Epsilon) { // Standard case (Slerp) - float omega = Mathf.acos(cosom); - sinom = Mathf.sin(omega); - scale0 = Mathf.sin((1.0f - t) * omega) / sinom; - scale1 = Mathf.sin(t * omega) / sinom; + float omega = Mathf.Acos(cosom); + sinom = Mathf.Sin(omega); + scale0 = Mathf.Sin((1.0f - t) * omega) / sinom; + scale1 = Mathf.Sin(t * omega) / sinom; } else { @@ -150,19 +150,19 @@ namespace Godot ); } - public Quat slerpni(Quat b, float t) + public Quat Slerpni(Quat b, float t) { - float dot = this.dot(b); + float dot = this.Dot(b); - if (Mathf.abs(dot) > 0.9999f) + if (Mathf.Abs(dot) > 0.9999f) { return this; } - float theta = Mathf.acos(dot); - float sinT = 1.0f / Mathf.sin(theta); - float newFactor = Mathf.sin(t * theta) * sinT; - float invFactor = Mathf.sin((1.0f - t) * theta) * sinT; + float theta = Mathf.Acos(dot); + float sinT = 1.0f / Mathf.Sin(theta); + float newFactor = Mathf.Sin(t * theta) * sinT; + float invFactor = Mathf.Sin((1.0f - t) * theta) * sinT; return new Quat ( @@ -173,10 +173,10 @@ namespace Godot ); } - public Vector3 xform(Vector3 v) + public Vector3 Xform(Vector3 v) { Quat q = this * v; - q *= this.inverse(); + q *= this.Inverse(); return new Vector3(q.x, q.y, q.z); } @@ -190,7 +190,7 @@ namespace Godot public Quat(Vector3 axis, float angle) { - float d = axis.length(); + float d = axis.Length(); if (d == 0f) { @@ -201,12 +201,12 @@ namespace Godot } else { - float s = Mathf.sin(angle * 0.5f) / d; + float s = Mathf.Sin(angle * 0.5f) / d; x = axis.x * s; y = axis.y * s; z = axis.z * s; - w = Mathf.cos(angle * 0.5f); + w = Mathf.Cos(angle * 0.5f); } } diff --git a/modules/mono/glue/cs_files/Rect2.cs b/modules/mono/glue/cs_files/Rect2.cs index 019342134a..f2718d7b7a 100644 --- a/modules/mono/glue/cs_files/Rect2.cs +++ b/modules/mono/glue/cs_files/Rect2.cs @@ -28,36 +28,36 @@ namespace Godot public float Area { - get { return get_area(); } + get { return GetArea(); } } - public Rect2 clip(Rect2 b) + public Rect2 Clip(Rect2 b) { Rect2 newRect = b; - if (!intersects(newRect)) + if (!Intersects(newRect)) return new Rect2(); - newRect.position.x = Mathf.max(b.position.x, position.x); - newRect.position.y = Mathf.max(b.position.y, position.y); + newRect.position.x = Mathf.Max(b.position.x, position.x); + newRect.position.y = Mathf.Max(b.position.y, position.y); Vector2 bEnd = b.position + b.size; Vector2 end = position + size; - newRect.size.x = Mathf.min(bEnd.x, end.x) - newRect.position.x; - newRect.size.y = Mathf.min(bEnd.y, end.y) - newRect.position.y; + newRect.size.x = Mathf.Min(bEnd.x, end.x) - newRect.position.x; + newRect.size.y = Mathf.Min(bEnd.y, end.y) - newRect.position.y; return newRect; } - public bool encloses(Rect2 b) + public bool Encloses(Rect2 b) { return (b.position.x >= position.x) && (b.position.y >= position.y) && ((b.position.x + b.size.x) < (position.x + size.x)) && ((b.position.y + b.size.y) < (position.y + size.y)); } - public Rect2 expand(Vector2 to) + public Rect2 Expand(Vector2 to) { Rect2 expanded = this; @@ -80,12 +80,12 @@ namespace Godot return expanded; } - public float get_area() + public float GetArea() { return size.x * size.y; } - public Rect2 grow(float by) + public Rect2 Grow(float by) { Rect2 g = this; @@ -97,7 +97,7 @@ namespace Godot return g; } - public Rect2 grow_individual(float left, float top, float right, float bottom) + public Rect2 GrowIndividual(float left, float top, float right, float bottom) { Rect2 g = this; @@ -109,11 +109,11 @@ namespace Godot return g; } - public Rect2 grow_margin(int margin, float by) + public Rect2 GrowMargin(int margin, float by) { Rect2 g = this; - g.grow_individual((GD.MARGIN_LEFT == margin) ? by : 0, + g.GrowIndividual((GD.MARGIN_LEFT == margin) ? by : 0, (GD.MARGIN_TOP == margin) ? by : 0, (GD.MARGIN_RIGHT == margin) ? by : 0, (GD.MARGIN_BOTTOM == margin) ? by : 0); @@ -121,12 +121,12 @@ namespace Godot return g; } - public bool has_no_area() + public bool HasNoArea() { return size.x <= 0 || size.y <= 0; } - public bool has_point(Vector2 point) + public bool HasPoint(Vector2 point) { if (point.x < position.x) return false; @@ -141,7 +141,7 @@ namespace Godot return true; } - public bool intersects(Rect2 b) + public bool Intersects(Rect2 b) { if (position.x > (b.position.x + b.size.x)) return false; @@ -155,15 +155,15 @@ namespace Godot return true; } - public Rect2 merge(Rect2 b) + public Rect2 Merge(Rect2 b) { Rect2 newRect; - newRect.position.x = Mathf.min(b.position.x, position.x); - newRect.position.y = Mathf.min(b.position.y, position.y); + newRect.position.x = Mathf.Min(b.position.x, position.x); + newRect.position.y = Mathf.Min(b.position.y, position.y); - newRect.size.x = Mathf.max(b.position.x + b.size.x, position.x + size.x); - newRect.size.y = Mathf.max(b.position.y + b.size.y, position.y + size.y); + newRect.size.x = Mathf.Max(b.position.x + b.size.x, position.x + size.x); + newRect.size.y = Mathf.Max(b.position.y + b.size.y, position.y + size.y); newRect.size = newRect.size - newRect.position; // Make relative again diff --git a/modules/mono/glue/cs_files/StringExtensions.cs b/modules/mono/glue/cs_files/StringExtensions.cs index 96041827aa..5c3ceff97d 100644 --- a/modules/mono/glue/cs_files/StringExtensions.cs +++ b/modules/mono/glue/cs_files/StringExtensions.cs @@ -10,15 +10,15 @@ namespace Godot { public static class StringExtensions { - private static int get_slice_count(this string instance, string splitter) + private static int GetSliceCount(this string instance, string splitter) { - if (instance.empty() || splitter.empty()) + if (instance.Empty() || splitter.Empty()) return 0; int pos = 0; int slices = 1; - while ((pos = instance.find(splitter, pos)) >= 0) + while ((pos = instance.Find(splitter, pos)) >= 0) { slices++; pos += splitter.Length; @@ -27,9 +27,9 @@ namespace Godot return slices; } - private static string get_slicec(this string instance, char splitter, int slice) + private static string GetSlicec(this string instance, char splitter, int slice) { - if (!instance.empty() && slice >= 0) + if (!instance.Empty() && slice >= 0) { int i = 0; int prev = 0; @@ -60,7 +60,7 @@ namespace Godot // <summary> // If the string is a path to a file, return the path to the file without the extension. // </summary> - public static string basename(this string instance) + public static string Basename(this string instance) { int index = instance.LastIndexOf('.'); @@ -73,7 +73,7 @@ namespace Godot // <summary> // Return true if the strings begins with the given string. // </summary> - public static bool begins_with(this string instance, string text) + public static bool BeginsWith(this string instance, string text) { return instance.StartsWith(text); } @@ -81,7 +81,7 @@ namespace Godot // <summary> // Return the bigrams (pairs of consecutive letters) of this string. // </summary> - public static string[] bigrams(this string instance) + public static string[] Bigrams(this string instance) { string[] b = new string[instance.Length - 1]; @@ -96,7 +96,7 @@ namespace Godot // <summary> // Return a copy of the string with special characters escaped using the C language standard. // </summary> - public static string c_escape(this string instance) + public static string CEscape(this string instance) { StringBuilder sb = new StringBuilder(string.Copy(instance)); @@ -118,7 +118,7 @@ namespace Godot // <summary> // Return a copy of the string with escaped characters replaced by their meanings according to the C language standard. // </summary> - public static string c_unescape(this string instance) + public static string CUnescape(this string instance) { StringBuilder sb = new StringBuilder(string.Copy(instance)); @@ -140,14 +140,14 @@ namespace Godot // <summary> // Change the case of some letters. Replace underscores with spaces, convert all letters to lowercase then capitalize first and every letter following the space character. For [code]capitalize camelCase mixed_with_underscores[/code] it will return [code]Capitalize Camelcase Mixed With Underscores[/code]. // </summary> - public static string capitalize(this string instance) + public static string Capitalize(this string instance) { string aux = instance.Replace("_", " ").ToLower(); string cap = string.Empty; - for (int i = 0; i < aux.get_slice_count(" "); i++) + for (int i = 0; i < aux.GetSliceCount(" "); i++) { - string slice = aux.get_slicec(' ', i); + string slice = aux.GetSlicec(' ', i); if (slice.Length > 0) { slice = char.ToUpper(slice[0]) + slice.Substring(1); @@ -163,12 +163,12 @@ namespace Godot // <summary> // Perform a case-sensitive comparison to another string, return -1 if less, 0 if equal and +1 if greater. // </summary> - public static int casecmp_to(this string instance, string to) + public static int CasecmpTo(this string instance, string to) { - if (instance.empty()) - return to.empty() ? 0 : -1; + if (instance.Empty()) + return to.Empty() ? 0 : -1; - if (to.empty()) + if (to.Empty()) return 1; int instance_idx = 0; @@ -195,7 +195,7 @@ namespace Godot // <summary> // Return true if the string is empty. // </summary> - public static bool empty(this string instance) + public static bool Empty(this string instance) { return string.IsNullOrEmpty(instance); } @@ -203,7 +203,7 @@ namespace Godot // <summary> // Return true if the strings ends with the given string. // </summary> - public static bool ends_with(this string instance, string text) + public static bool EndsWith(this string instance, string text) { return instance.EndsWith(text); } @@ -211,7 +211,7 @@ namespace Godot // <summary> // Erase [code]chars[/code] characters from the string starting from [code]pos[/code]. // </summary> - public static void erase(this StringBuilder instance, int pos, int chars) + public static void Erase(this StringBuilder instance, int pos, int chars) { instance.Remove(pos, chars); } @@ -219,9 +219,9 @@ namespace Godot // <summary> // If the string is a path to a file, return the extension. // </summary> - public static string extension(this string instance) + public static string Extension(this string instance) { - int pos = instance.find_last("."); + int pos = instance.FindLast("."); if (pos < 0) return instance; @@ -232,7 +232,7 @@ namespace Godot // <summary> // Find the first occurrence of a substring, return the starting position of the substring or -1 if not found. Optionally, the initial search index can be passed. // </summary> - public static int find(this string instance, string what, int from = 0) + public static int Find(this string instance, string what, int from = 0) { return instance.IndexOf(what, StringComparison.OrdinalIgnoreCase); } @@ -240,7 +240,7 @@ namespace Godot // <summary> // Find the last occurrence of a substring, return the starting position of the substring or -1 if not found. Optionally, the initial search index can be passed. // </summary> - public static int find_last(this string instance, string what) + public static int FindLast(this string instance, string what) { return instance.LastIndexOf(what, StringComparison.OrdinalIgnoreCase); } @@ -248,7 +248,7 @@ namespace Godot // <summary> // Find the first occurrence of a substring but search as case-insensitive, return the starting position of the substring or -1 if not found. Optionally, the initial search index can be passed. // </summary> - public static int findn(this string instance, string what, int from = 0) + public static int FindN(this string instance, string what, int from = 0) { return instance.IndexOf(what, StringComparison.Ordinal); } @@ -256,9 +256,9 @@ namespace Godot // <summary> // If the string is a path to a file, return the base directory. // </summary> - public static string get_base_dir(this string instance) + public static string GetBaseDir(this string instance) { - int basepos = instance.find("://"); + int basepos = instance.Find("://"); string rs = string.Empty; string @base = string.Empty; @@ -271,7 +271,7 @@ namespace Godot } else { - if (instance.begins_with("/")) + if (instance.BeginsWith("/")) { rs = instance.Substring(1, instance.Length); @base = "/"; @@ -282,7 +282,7 @@ namespace Godot } } - int sep = Mathf.max(rs.find_last("/"), rs.find_last("\\")); + int sep = Mathf.Max(rs.FindLast("/"), rs.FindLast("\\")); if (sep == -1) return @base; @@ -293,9 +293,9 @@ namespace Godot // <summary> // If the string is a path to a file, return the file and ignore the base directory. // </summary> - public static string get_file(this string instance) + public static string GetFile(this string instance) { - int sep = Mathf.max(instance.find_last("/"), instance.find_last("\\")); + int sep = Mathf.Max(instance.FindLast("/"), instance.FindLast("\\")); if (sep == -1) return instance; @@ -306,7 +306,7 @@ namespace Godot // <summary> // Hash the string and return a 32 bits integer. // </summary> - public static int hash(this string instance) + public static int Hash(this string instance) { int index = 0; int hashv = 5381; @@ -321,7 +321,7 @@ namespace Godot // <summary> // Convert a string containing an hexadecimal number into an int. // </summary> - public static int hex_to_int(this string instance) + public static int HexToInt(this string instance) { int sign = 1; @@ -340,7 +340,7 @@ namespace Godot // <summary> // Insert a substring at a given position. // </summary> - public static string insert(this string instance, int pos, string what) + public static string Insert(this string instance, int pos, string what) { return instance.Insert(pos, what); } @@ -348,7 +348,7 @@ namespace Godot // <summary> // If the string is a path to a file or directory, return true if the path is absolute. // </summary> - public static bool is_abs_path(this string instance) + public static bool IsAbsPath(this string instance) { return System.IO.Path.IsPathRooted(instance); } @@ -356,7 +356,7 @@ namespace Godot // <summary> // If the string is a path to a file or directory, return true if the path is relative. // </summary> - public static bool is_rel_path(this string instance) + public static bool IsRelPath(this string instance) { return !System.IO.Path.IsPathRooted(instance); } @@ -364,7 +364,7 @@ namespace Godot // <summary> // Check whether this string is a subsequence of the given string. // </summary> - public static bool is_subsequence_of(this string instance, string text, bool case_insensitive) + public static bool IsSubsequenceOf(this string instance, string text, bool case_insensitive) { int len = instance.Length; @@ -407,23 +407,23 @@ namespace Godot // <summary> // Check whether this string is a subsequence of the given string, considering case. // </summary> - public static bool is_subsequence_of(this string instance, string text) + public static bool IsSubsequenceOf(this string instance, string text) { - return instance.is_subsequence_of(text, false); + return instance.IsSubsequenceOf(text, false); } // <summary> // Check whether this string is a subsequence of the given string, without considering case. // </summary> - public static bool is_subsequence_ofi(this string instance, string text) + public static bool IsSubsequenceOfI(this string instance, string text) { - return instance.is_subsequence_of(text, true); + return instance.IsSubsequenceOf(text, true); } // <summary> // Check whether the string contains a valid float. // </summary> - public static bool is_valid_float(this string instance) + public static bool IsValidFloat(this string instance) { float f; return float.TryParse(instance, out f); @@ -432,15 +432,15 @@ namespace Godot // <summary> // Check whether the string contains a valid color in HTML notation. // </summary> - public static bool is_valid_html_color(this string instance) + public static bool IsValidHtmlColor(this string instance) { - return Color.html_is_valid(instance); + return Color.HtmlIsValid(instance); } // <summary> // Check whether the string is a valid identifier. As is common in programming languages, a valid identifier may contain only letters, digits and underscores (_) and the first character may not be a digit. // </summary> - public static bool is_valid_identifier(this string instance) + public static bool IsValidIdentifier(this string instance) { int len = instance.Length; @@ -467,7 +467,7 @@ namespace Godot // <summary> // Check whether the string contains a valid integer. // </summary> - public static bool is_valid_integer(this string instance) + public static bool IsValidInteger(this string instance) { int f; return int.TryParse(instance, out f); @@ -476,7 +476,7 @@ namespace Godot // <summary> // Check whether the string contains a valid IP address. // </summary> - public static bool is_valid_ip_address(this string instance) + public static bool IsValidIpAddress(this string instance) { string[] ip = instance.split("."); @@ -486,7 +486,7 @@ namespace Godot for (int i = 0; i < ip.Length; i++) { string n = ip[i]; - if (!n.is_valid_integer()) + if (!n.IsValidInteger()) return false; int val = n.to_int(); @@ -500,7 +500,7 @@ namespace Godot // <summary> // Return a copy of the string with special characters escaped using the JSON standard. // </summary> - public static string json_escape(this string instance) + public static string JsonEscape(this string instance) { StringBuilder sb = new StringBuilder(string.Copy(instance)); @@ -519,7 +519,7 @@ namespace Godot // <summary> // Return an amount of characters from the left of the string. // </summary> - public static string left(this string instance, int pos) + public static string Left(this string instance, int pos) { if (pos <= 0) return string.Empty; @@ -533,7 +533,7 @@ namespace Godot /// <summary> /// Return the length of the string in characters. /// </summary> - public static int length(this string instance) + public static int Length(this string instance) { return instance.Length; } @@ -541,7 +541,7 @@ namespace Godot // <summary> // Do a simple expression match, where '*' matches zero or more arbitrary characters and '?' matches any single character except '.'. // </summary> - public static bool expr_match(this string instance, string expr, bool case_sensitive) + public static bool ExprMatch(this string instance, string expr, bool caseSensitive) { if (expr.Length == 0 || instance.Length == 0) return false; @@ -551,21 +551,21 @@ namespace Godot case '\0': return instance[0] == 0; case '*': - return expr_match(expr + 1, instance, case_sensitive) || (instance[0] != 0 && expr_match(expr, instance + 1, case_sensitive)); + return ExprMatch(expr + 1, instance, caseSensitive) || (instance[0] != 0 && ExprMatch(expr, instance + 1, caseSensitive)); case '?': - return instance[0] != 0 && instance[0] != '.' && expr_match(expr + 1, instance + 1, case_sensitive); + return instance[0] != 0 && instance[0] != '.' && ExprMatch(expr + 1, instance + 1, caseSensitive); default: - return (case_sensitive ? instance[0] == expr[0] : char.ToUpper(instance[0]) == char.ToUpper(expr[0])) && - expr_match(expr + 1, instance + 1, case_sensitive); + return (caseSensitive ? instance[0] == expr[0] : char.ToUpper(instance[0]) == char.ToUpper(expr[0])) && + ExprMatch(expr + 1, instance + 1, caseSensitive); } } // <summary> // Do a simple case sensitive expression match, using ? and * wildcards (see [method expr_match]). // </summary> - public static bool match(this string instance, string expr) + public static bool Match(this string instance, string expr) { - return instance.expr_match(expr, true); + return instance.ExprMatch(expr, true); } // <summary> @@ -573,13 +573,13 @@ namespace Godot // </summary> public static bool matchn(this string instance, string expr) { - return instance.expr_match(expr, false); + return instance.ExprMatch(expr, false); } // <summary> // Return the MD5 hash of the string as an array of bytes. // </summary> - public static byte[] md5_buffer(this string instance) + public static byte[] Md5Buffer(this string instance) { return NativeCalls.godot_icall_String_md5_buffer(instance); } @@ -587,7 +587,7 @@ namespace Godot // <summary> // Return the MD5 hash of the string as a string. // </summary> - public static string md5_text(this string instance) + public static string Md5Text(this string instance) { return NativeCalls.godot_icall_String_md5_text(instance); } @@ -595,12 +595,12 @@ namespace Godot // <summary> // Perform a case-insensitive comparison to another string, return -1 if less, 0 if equal and +1 if greater. // </summary> - public static int nocasecmp_to(this string instance, string to) + public static int NocasecmpTo(this string instance, string to) { - if (instance.empty()) - return to.empty() ? 0 : -1; + if (instance.Empty()) + return to.Empty() ? 0 : -1; - if (to.empty()) + if (to.Empty()) return 1; int instance_idx = 0; @@ -627,7 +627,7 @@ namespace Godot // <summary> // Return the character code at position [code]at[/code]. // </summary> - public static int ord_at(this string instance, int at) + public static int OrdAt(this string instance, int at) { return instance[at]; } @@ -635,9 +635,9 @@ namespace Godot // <summary> // Format a number to have an exact number of [code]digits[/code] after the decimal point. // </summary> - public static string pad_decimals(this string instance, int digits) + public static string PadDecimals(this string instance, int digits) { - int c = instance.find("."); + int c = instance.Find("."); if (c == -1) { @@ -671,10 +671,10 @@ namespace Godot // <summary> // Format a number to have an exact number of [code]digits[/code] before the decimal point. // </summary> - public static string pad_zeros(this string instance, int digits) + public static string PadZeros(this string instance, int digits) { string s = instance; - int end = s.find("."); + int end = s.Find("."); if (end == -1) end = s.Length; @@ -704,7 +704,7 @@ namespace Godot // <summary> // Decode a percent-encoded string. See [method percent_encode]. // </summary> - public static string percent_decode(this string instance) + public static string PercentDecode(this string instance) { return Uri.UnescapeDataString(instance); } @@ -712,7 +712,7 @@ namespace Godot // <summary> // Percent-encode a string. This is meant to encode parameters in a URL when sending a HTTP GET request and bodies of form-urlencoded POST request. // </summary> - public static string percent_encode(this string instance) + public static string PercentEncode(this string instance) { return Uri.EscapeDataString(instance); } @@ -720,7 +720,7 @@ namespace Godot // <summary> // If the string is a path, this concatenates [code]file[/code] at the end of the string as a subpath. E.g. [code]"this/is".plus_file("path") == "this/is/path"[/code]. // </summary> - public static string plus_file(this string instance, string file) + public static string PlusFile(this string instance, string file) { if (instance.Length > 0 && instance[instance.Length - 1] == '/') return instance + file; @@ -731,7 +731,7 @@ namespace Godot // <summary> // Replace occurrences of a substring for different ones inside the string. // </summary> - public static string replace(this string instance, string what, string forwhat) + public static string Replace(this string instance, string what, string forwhat) { return instance.Replace(what, forwhat); } @@ -739,7 +739,7 @@ namespace Godot // <summary> // Replace occurrences of a substring for different ones inside the string, but search case-insensitive. // </summary> - public static string replacen(this string instance, string what, string forwhat) + public static string Replacen(this string instance, string what, string forwhat) { return Regex.Replace(instance, what, forwhat, RegexOptions.IgnoreCase); } @@ -747,7 +747,7 @@ namespace Godot // <summary> // Perform a search for a substring, but start from the end of the string instead of the beginning. // </summary> - public static int rfind(this string instance, string what, int from = -1) + public static int Rfind(this string instance, string what, int from = -1) { return NativeCalls.godot_icall_String_rfind(instance, what, from); } @@ -755,7 +755,7 @@ namespace Godot // <summary> // Perform a search for a substring, but start from the end of the string instead of the beginning. Also search case-insensitive. // </summary> - public static int rfindn(this string instance, string what, int from = -1) + public static int Rfindn(this string instance, string what, int from = -1) { return NativeCalls.godot_icall_String_rfindn(instance, what, from); } @@ -763,7 +763,7 @@ namespace Godot // <summary> // Return the right side of the string from a given position. // </summary> - public static string right(this string instance, int pos) + public static string Right(this string instance, int pos) { if (pos >= instance.Length) return instance; @@ -774,7 +774,7 @@ namespace Godot return instance.Substring(pos, (instance.Length - pos)); } - public static byte[] sha256_buffer(this string instance) + public static byte[] Sha256Buffer(this string instance) { return NativeCalls.godot_icall_String_sha256_buffer(instance); } @@ -782,7 +782,7 @@ namespace Godot // <summary> // Return the SHA-256 hash of the string as a string. // </summary> - public static string sha256_text(this string instance) + public static string Sha256Text(this string instance) { return NativeCalls.godot_icall_String_sha256_text(instance); } @@ -790,7 +790,7 @@ namespace Godot // <summary> // Return the similarity index of the text compared to this string. 1 means totally similar and 0 means totally dissimilar. // </summary> - public static float similarity(this string instance, string text) + public static float Similarity(this string instance, string text) { if (instance == text) { @@ -803,11 +803,11 @@ namespace Godot return 0.0f; } - string[] src_bigrams = instance.bigrams(); - string[] tgt_bigrams = text.bigrams(); + string[] srcBigrams = instance.Bigrams(); + string[] tgtBigrams = text.Bigrams(); - int src_size = src_bigrams.Length; - int tgt_size = tgt_bigrams.Length; + int src_size = srcBigrams.Length; + int tgt_size = tgtBigrams.Length; float sum = src_size + tgt_size; float inter = 0; @@ -816,7 +816,7 @@ namespace Godot { for (int j = 0; j < tgt_size; j++) { - if (src_bigrams[i] == tgt_bigrams[j]) + if (srcBigrams[i] == tgtBigrams[j]) { inter++; break; @@ -846,7 +846,7 @@ namespace Godot while (true) { - int end = instance.find(divisor, from); + int end = instance.Find(divisor, from); if (end < 0) end = len; if (allow_empty || (end > from)) diff --git a/modules/mono/glue/cs_files/Transform.cs b/modules/mono/glue/cs_files/Transform.cs index 74271e758b..5214100d36 100644 --- a/modules/mono/glue/cs_files/Transform.cs +++ b/modules/mono/glue/cs_files/Transform.cs @@ -9,38 +9,38 @@ namespace Godot public Basis basis; public Vector3 origin; - public Transform affine_inverse() + public Transform AffineInverse() { - Basis basisInv = basis.inverse(); - return new Transform(basisInv, basisInv.xform(-origin)); + Basis basisInv = basis.Inverse(); + return new Transform(basisInv, basisInv.Xform(-origin)); } - public Transform inverse() + public Transform Inverse() { - Basis basisTr = basis.transposed(); - return new Transform(basisTr, basisTr.xform(-origin)); + Basis basisTr = basis.Transposed(); + return new Transform(basisTr, basisTr.Xform(-origin)); } - public Transform looking_at(Vector3 target, Vector3 up) + public Transform LookingAt(Vector3 target, Vector3 up) { Transform t = this; t.set_look_at(origin, target, up); return t; } - public Transform orthonormalized() + public Transform Orthonormalized() { - return new Transform(basis.orthonormalized(), origin); + return new Transform(basis.Orthonormalized(), origin); } - public Transform rotated(Vector3 axis, float phi) + public Transform Rotated(Vector3 axis, float phi) { return new Transform(new Basis(axis, phi), new Vector3()) * this; } - public Transform scaled(Vector3 scale) + public Transform Scaled(Vector3 scale) { - return new Transform(basis.scaled(scale), origin * scale); + return new Transform(basis.Scaled(scale), origin * scale); } public void set_look_at(Vector3 eye, Vector3 target, Vector3 up) @@ -49,44 +49,44 @@ namespace Godot // Z vector Vector3 zAxis = eye - target; - zAxis.normalize(); + zAxis.Normalize(); Vector3 yAxis = up; - Vector3 xAxis = yAxis.cross(zAxis); + Vector3 xAxis = yAxis.Cross(zAxis); // Recompute Y = Z cross X - yAxis = zAxis.cross(xAxis); + yAxis = zAxis.Cross(xAxis); - xAxis.normalize(); - yAxis.normalize(); + xAxis.Normalize(); + yAxis.Normalize(); - basis = Basis.create_from_axes(xAxis, yAxis, zAxis); + basis = Basis.CreateFromAxes(xAxis, yAxis, zAxis); origin = eye; } - public Transform translated(Vector3 ofs) + public Transform Translated(Vector3 ofs) { return new Transform(basis, new Vector3 ( - origin[0] += basis[0].dot(ofs), - origin[1] += basis[1].dot(ofs), - origin[2] += basis[2].dot(ofs) + origin[0] += basis[0].Dot(ofs), + origin[1] += basis[1].Dot(ofs), + origin[2] += basis[2].Dot(ofs) )); } - public Vector3 xform(Vector3 v) + public Vector3 Xform(Vector3 v) { return new Vector3 ( - basis[0].dot(v) + origin.x, - basis[1].dot(v) + origin.y, - basis[2].dot(v) + origin.z + basis[0].Dot(v) + origin.x, + basis[1].Dot(v) + origin.y, + basis[2].Dot(v) + origin.z ); } - public Vector3 xform_inv(Vector3 v) + public Vector3 XformInv(Vector3 v) { Vector3 vInv = v - origin; @@ -100,7 +100,7 @@ namespace Godot public Transform(Vector3 xAxis, Vector3 yAxis, Vector3 zAxis, Vector3 origin) { - this.basis = Basis.create_from_axes(xAxis, yAxis, zAxis); + this.basis = Basis.CreateFromAxes(xAxis, yAxis, zAxis); this.origin = origin; } @@ -118,7 +118,7 @@ namespace Godot public static Transform operator *(Transform left, Transform right) { - left.origin = left.xform(right.origin); + left.origin = left.Xform(right.origin); left.basis *= right.basis; return left; } diff --git a/modules/mono/glue/cs_files/Transform2D.cs b/modules/mono/glue/cs_files/Transform2D.cs index 526dc767c6..fe7c5b5706 100644 --- a/modules/mono/glue/cs_files/Transform2D.cs +++ b/modules/mono/glue/cs_files/Transform2D.cs @@ -29,12 +29,12 @@ namespace Godot public float Rotation { - get { return Mathf.atan2(y.x, o.y); } + get { return Mathf.Atan2(y.x, o.y); } } public Vector2 Scale { - get { return new Vector2(x.length(), y.length()); } + get { return new Vector2(x.Length(), y.Length()); } } public Vector2 this[int index] @@ -103,7 +103,7 @@ namespace Godot } } - public Transform2D affine_inverse() + public Transform2D AffineInverse() { Transform2D inv = this; @@ -128,22 +128,22 @@ namespace Godot this[0] *= new Vector2(idet, -idet); this[1] *= new Vector2(-idet, idet); - this[2] = basis_xform(-this[2]); + this[2] = BasisXform(-this[2]); return inv; } - public Vector2 basis_xform(Vector2 v) + public Vector2 BasisXform(Vector2 v) { - return new Vector2(tdotx(v), tdoty(v)); + return new Vector2(Tdotx(v), Tdoty(v)); } - public Vector2 basis_xform_inv(Vector2 v) + public Vector2 BasisXformInv(Vector2 v) { - return new Vector2(x.dot(v), y.dot(v)); + return new Vector2(x.Dot(v), y.Dot(v)); } - public Transform2D interpolate_with(Transform2D m, float c) + public Transform2D InterpolateWith(Transform2D m, float c) { float r1 = Rotation; float r2 = m.Rotation; @@ -152,10 +152,10 @@ namespace Godot Vector2 s2 = m.Scale; // Slerp rotation - Vector2 v1 = new Vector2(Mathf.cos(r1), Mathf.sin(r1)); - Vector2 v2 = new Vector2(Mathf.cos(r2), Mathf.sin(r2)); + Vector2 v1 = new Vector2(Mathf.Cos(r1), Mathf.Sin(r1)); + Vector2 v2 = new Vector2(Mathf.Cos(r2), Mathf.Sin(r2)); - float dot = v1.dot(v2); + float dot = v1.Dot(v2); // Clamp dot to [-1, 1] dot = (dot < -1.0f) ? -1.0f : ((dot > 1.0f) ? 1.0f : dot); @@ -165,13 +165,13 @@ namespace Godot if (dot > 0.9995f) { // Linearly interpolate to avoid numerical precision issues - v = v1.linear_interpolate(v2, c).normalized(); + v = v1.LinearInterpolate(v2, c).Normalized(); } else { - float angle = c * Mathf.acos(dot); - Vector2 v3 = (v2 - v1 * dot).normalized(); - v = v1 * Mathf.cos(angle) + v3 * Mathf.sin(angle); + float angle = c * Mathf.Acos(dot); + Vector2 v3 = (v2 - v1 * dot).Normalized(); + v = v1 * Mathf.Cos(angle) + v3 * Mathf.Sin(angle); } // Extract parameters @@ -179,15 +179,15 @@ namespace Godot Vector2 p2 = m.Origin; // Construct matrix - Transform2D res = new Transform2D(Mathf.atan2(v.y, v.x), p1.linear_interpolate(p2, c)); - Vector2 scale = s1.linear_interpolate(s2, c); + Transform2D res = new Transform2D(Mathf.Atan2(v.y, v.x), p1.LinearInterpolate(p2, c)); + Vector2 scale = s1.LinearInterpolate(s2, c); res.x *= scale; res.y *= scale; return res; } - public Transform2D inverse() + public Transform2D Inverse() { Transform2D inv = this; @@ -196,21 +196,21 @@ namespace Godot inv.x.y = inv.y.x; inv.y.x = temp; - inv.o = inv.basis_xform(-inv.o); + inv.o = inv.BasisXform(-inv.o); return inv; } - public Transform2D orthonormalized() + public Transform2D Orthonormalized() { Transform2D on = this; Vector2 onX = on.x; Vector2 onY = on.y; - onX.normalize(); - onY = onY - onX * (onX.dot(onY)); - onY.normalize(); + onX.Normalize(); + onY = onY - onX * (onX.Dot(onY)); + onY.Normalize(); on.x = onX; on.y = onY; @@ -218,12 +218,12 @@ namespace Godot return on; } - public Transform2D rotated(float phi) + public Transform2D Rotated(float phi) { return this * new Transform2D(phi, new Vector2()); } - public Transform2D scaled(Vector2 scale) + public Transform2D Scaled(Vector2 scale) { Transform2D copy = this; copy.x *= scale; @@ -232,32 +232,32 @@ namespace Godot return copy; } - private float tdotx(Vector2 with) + private float Tdotx(Vector2 with) { return this[0, 0] * with[0] + this[1, 0] * with[1]; } - private float tdoty(Vector2 with) + private float Tdoty(Vector2 with) { return this[0, 1] * with[0] + this[1, 1] * with[1]; } - public Transform2D translated(Vector2 offset) + public Transform2D Translated(Vector2 offset) { Transform2D copy = this; - copy.o += copy.basis_xform(offset); + copy.o += copy.BasisXform(offset); return copy; } - public Vector2 xform(Vector2 v) + public Vector2 Xform(Vector2 v) { - return new Vector2(tdotx(v), tdoty(v)) + o; + return new Vector2(Tdotx(v), Tdoty(v)) + o; } - public Vector2 xform_inv(Vector2 v) + public Vector2 XformInv(Vector2 v) { Vector2 vInv = v - o; - return new Vector2(x.dot(vInv), y.dot(vInv)); + return new Vector2(x.Dot(vInv), y.Dot(vInv)); } public Transform2D(Vector2 xAxis, Vector2 yAxis, Vector2 origin) @@ -275,8 +275,8 @@ namespace Godot public Transform2D(float rot, Vector2 pos) { - float cr = Mathf.cos(rot); - float sr = Mathf.sin(rot); + float cr = Mathf.Cos(rot); + float sr = Mathf.Sin(rot); x.x = cr; y.y = cr; x.y = -sr; @@ -286,14 +286,14 @@ namespace Godot public static Transform2D operator *(Transform2D left, Transform2D right) { - left.o = left.xform(right.o); + left.o = left.Xform(right.o); float x0, x1, y0, y1; - x0 = left.tdotx(right.x); - x1 = left.tdoty(right.x); - y0 = left.tdotx(right.y); - y1 = left.tdoty(right.y); + x0 = left.Tdotx(right.x); + x1 = left.Tdoty(right.x); + y0 = left.Tdotx(right.y); + y1 = left.Tdoty(right.y); left.x.x = x0; left.x.y = x1; diff --git a/modules/mono/glue/cs_files/Vector2.cs b/modules/mono/glue/cs_files/Vector2.cs index 28fedc365b..238775bda2 100644 --- a/modules/mono/glue/cs_files/Vector2.cs +++ b/modules/mono/glue/cs_files/Vector2.cs @@ -46,57 +46,57 @@ namespace Godot } } - internal void normalize() + internal void Normalize() { float length = x * x + y * y; if (length != 0f) { - length = Mathf.sqrt(length); + length = Mathf.Sqrt(length); x /= length; y /= length; } } - private float cross(Vector2 b) + private float Cross(Vector2 b) { return x * b.y - y * b.x; } - public Vector2 abs() + public Vector2 Abs() { - return new Vector2(Mathf.abs(x), Mathf.abs(y)); + return new Vector2(Mathf.Abs(x), Mathf.Abs(y)); } - public float angle() + public float Angle() { - return Mathf.atan2(y, x); + return Mathf.Atan2(y, x); } - public float angle_to(Vector2 to) + public float AngleTo(Vector2 to) { - return Mathf.atan2(cross(to), dot(to)); + return Mathf.Atan2(Cross(to), Dot(to)); } - public float angle_to_point(Vector2 to) + public float AngleToPoint(Vector2 to) { - return Mathf.atan2(x - to.x, y - to.y); + return Mathf.Atan2(x - to.x, y - to.y); } - public float aspect() + public float Aspect() { return x / y; } - public Vector2 bounce(Vector2 n) + public Vector2 Bounce(Vector2 n) { - return -reflect(n); + return -Reflect(n); } - public Vector2 clamped(float length) + public Vector2 Clamped(float length) { Vector2 v = this; - float l = this.length(); + float l = this.Length(); if (l > 0 && length < l) { @@ -107,7 +107,7 @@ namespace Godot return v; } - public Vector2 cubic_interpolate(Vector2 b, Vector2 preA, Vector2 postB, float t) + public Vector2 CubicInterpolate(Vector2 b, Vector2 preA, Vector2 postB, float t) { Vector2 p0 = preA; Vector2 p1 = this; @@ -123,42 +123,42 @@ namespace Godot (-p0 + 3.0f * p1 - 3.0f * p2 + p3) * t3); } - public float distance_squared_to(Vector2 to) + public float DistanceSquaredTo(Vector2 to) { return (x - to.x) * (x - to.x) + (y - to.y) * (y - to.y); } - public float distance_to(Vector2 to) + public float DistanceTo(Vector2 to) { - return Mathf.sqrt((x - to.x) * (x - to.x) + (y - to.y) * (y - to.y)); + return Mathf.Sqrt((x - to.x) * (x - to.x) + (y - to.y) * (y - to.y)); } - public float dot(Vector2 with) + public float Dot(Vector2 with) { return x * with.x + y * with.y; } - public Vector2 floor() + public Vector2 Floor() { - return new Vector2(Mathf.floor(x), Mathf.floor(y)); + return new Vector2(Mathf.Floor(x), Mathf.Floor(y)); } - public bool is_normalized() + public bool IsNormalized() { - return Mathf.abs(length_squared() - 1.0f) < Mathf.Epsilon; + return Mathf.Abs(LengthSquared() - 1.0f) < Mathf.Epsilon; } - public float length() + public float Length() { - return Mathf.sqrt(x * x + y * y); + return Mathf.Sqrt(x * x + y * y); } - public float length_squared() + public float LengthSquared() { return x * x + y * y; } - public Vector2 linear_interpolate(Vector2 b, float t) + public Vector2 LinearInterpolate(Vector2 b, float t) { Vector2 res = this; @@ -168,35 +168,35 @@ namespace Godot return res; } - public Vector2 normalized() + public Vector2 Normalized() { Vector2 result = this; - result.normalize(); + result.Normalize(); return result; } - public Vector2 reflect(Vector2 n) + public Vector2 Reflect(Vector2 n) { - return 2.0f * n * dot(n) - this; + return 2.0f * n * Dot(n) - this; } - public Vector2 rotated(float phi) + public Vector2 Rotated(float phi) { - float rads = angle() + phi; - return new Vector2(Mathf.cos(rads), Mathf.sin(rads)) * length(); + float rads = Angle() + phi; + return new Vector2(Mathf.Cos(rads), Mathf.Sin(rads)) * Length(); } - public Vector2 slide(Vector2 n) + public Vector2 Slide(Vector2 n) { - return this - n * dot(n); + return this - n * Dot(n); } - public Vector2 snapped(Vector2 by) + public Vector2 Snapped(Vector2 by) { - return new Vector2(Mathf.stepify(x, by.x), Mathf.stepify(y, by.y)); + return new Vector2(Mathf.Stepify(x, by.x), Mathf.Stepify(y, by.y)); } - public Vector2 tangent() + public Vector2 Tangent() { return new Vector2(y, -x); } diff --git a/modules/mono/glue/cs_files/Vector3.cs b/modules/mono/glue/cs_files/Vector3.cs index c023cd83cf..190caa4b53 100644 --- a/modules/mono/glue/cs_files/Vector3.cs +++ b/modules/mono/glue/cs_files/Vector3.cs @@ -59,9 +59,9 @@ namespace Godot } } - internal void normalize() + internal void Normalize() { - float length = this.length(); + float length = this.Length(); if (length == 0f) { @@ -75,27 +75,27 @@ namespace Godot } } - public Vector3 abs() + public Vector3 Abs() { - return new Vector3(Mathf.abs(x), Mathf.abs(y), Mathf.abs(z)); + return new Vector3(Mathf.Abs(x), Mathf.Abs(y), Mathf.Abs(z)); } - public float angle_to(Vector3 to) + public float AngleTo(Vector3 to) { - return Mathf.atan2(cross(to).length(), dot(to)); + return Mathf.Atan2(Cross(to).Length(), Dot(to)); } - public Vector3 bounce(Vector3 n) + public Vector3 Bounce(Vector3 n) { - return -reflect(n); + return -Reflect(n); } - public Vector3 ceil() + public Vector3 Ceil() { - return new Vector3(Mathf.ceil(x), Mathf.ceil(y), Mathf.ceil(z)); + return new Vector3(Mathf.Ceil(x), Mathf.Ceil(y), Mathf.Ceil(z)); } - public Vector3 cross(Vector3 b) + public Vector3 Cross(Vector3 b) { return new Vector3 ( @@ -105,7 +105,7 @@ namespace Godot ); } - public Vector3 cubic_interpolate(Vector3 b, Vector3 preA, Vector3 postB, float t) + public Vector3 CubicInterpolate(Vector3 b, Vector3 preA, Vector3 postB, float t) { Vector3 p0 = preA; Vector3 p1 = this; @@ -122,46 +122,46 @@ namespace Godot ); } - public float distance_squared_to(Vector3 b) + public float DistanceSquaredTo(Vector3 b) { - return (b - this).length_squared(); + return (b - this).LengthSquared(); } - public float distance_to(Vector3 b) + public float DistanceTo(Vector3 b) { - return (b - this).length(); + return (b - this).Length(); } - public float dot(Vector3 b) + public float Dot(Vector3 b) { return x * b.x + y * b.y + z * b.z; } - public Vector3 floor() + public Vector3 Floor() { - return new Vector3(Mathf.floor(x), Mathf.floor(y), Mathf.floor(z)); + return new Vector3(Mathf.Floor(x), Mathf.Floor(y), Mathf.Floor(z)); } - public Vector3 inverse() + public Vector3 Inverse() { return new Vector3(1.0f / x, 1.0f / y, 1.0f / z); } - public bool is_normalized() + public bool IsNormalized() { - return Mathf.abs(length_squared() - 1.0f) < Mathf.Epsilon; + return Mathf.Abs(LengthSquared() - 1.0f) < Mathf.Epsilon; } - public float length() + public float Length() { float x2 = x * x; float y2 = y * y; float z2 = z * z; - return Mathf.sqrt(x2 + y2 + z2); + return Mathf.Sqrt(x2 + y2 + z2); } - public float length_squared() + public float LengthSquared() { float x2 = x * x; float y2 = y * y; @@ -170,7 +170,7 @@ namespace Godot return x2 + y2 + z2; } - public Vector3 linear_interpolate(Vector3 b, float t) + public Vector3 LinearInterpolate(Vector3 b, float t) { return new Vector3 ( @@ -180,24 +180,24 @@ namespace Godot ); } - public Axis max_axis() + public Axis MaxAxis() { return x < y ? (y < z ? Axis.Z : Axis.Y) : (x < z ? Axis.Z : Axis.X); } - public Axis min_axis() + public Axis MinAxis() { return x < y ? (x < z ? Axis.X : Axis.Z) : (y < z ? Axis.Y : Axis.Z); } - public Vector3 normalized() + public Vector3 Normalized() { Vector3 v = this; - v.normalize(); + v.Normalize(); return v; } - public Basis outer(Vector3 b) + public Basis Outer(Vector3 b) { return new Basis( new Vector3(x * b.x, x * b.y, x * b.z), @@ -206,36 +206,36 @@ namespace Godot ); } - public Vector3 reflect(Vector3 n) + public Vector3 Reflect(Vector3 n) { #if DEBUG - if (!n.is_normalized()) + if (!n.IsNormalized()) throw new ArgumentException(String.Format("{0} is not normalized", n), nameof(n)); #endif - return 2.0f * n * dot(n) - this; + return 2.0f * n * Dot(n) - this; } - public Vector3 rotated(Vector3 axis, float phi) + public Vector3 Rotated(Vector3 axis, float phi) { - return new Basis(axis, phi).xform(this); + return new Basis(axis, phi).Xform(this); } - public Vector3 slide(Vector3 n) + public Vector3 Slide(Vector3 n) { - return this - n * dot(n); + return this - n * Dot(n); } - public Vector3 snapped(Vector3 by) + public Vector3 Snapped(Vector3 by) { return new Vector3 ( - Mathf.stepify(x, by.x), - Mathf.stepify(y, by.y), - Mathf.stepify(z, by.z) + Mathf.Stepify(x, by.x), + Mathf.Stepify(y, by.y), + Mathf.Stepify(z, by.z) ); } - public Basis to_diagonal_matrix() + public Basis ToDiagonalMatrix() { return new Basis( x, 0f, 0f, diff --git a/modules/mono/godotsharp_dirs.cpp b/modules/mono/godotsharp_dirs.cpp index a0c2508b0d..0f6245a37c 100644 --- a/modules/mono/godotsharp_dirs.cpp +++ b/modules/mono/godotsharp_dirs.cpp @@ -192,4 +192,4 @@ String get_project_csproj_path() { return _GodotSharpDirs::get_singleton().csproj_filepath; } #endif -} +} // namespace GodotSharpDirs diff --git a/modules/mono/godotsharp_dirs.h b/modules/mono/godotsharp_dirs.h index ba2c065210..914df40629 100644 --- a/modules/mono/godotsharp_dirs.h +++ b/modules/mono/godotsharp_dirs.h @@ -53,6 +53,6 @@ String get_custom_project_settings_dir(); String get_project_sln_path(); String get_project_csproj_path(); -} +} // namespace GodotSharpDirs #endif // GODOTSHARP_DIRS_H diff --git a/modules/mono/mono_gc_handle.cpp b/modules/mono/mono_gc_handle.cpp index e10e06df0e..121392b3f8 100644 --- a/modules/mono/mono_gc_handle.cpp +++ b/modules/mono/mono_gc_handle.cpp @@ -36,7 +36,7 @@ uint32_t MonoGCHandle::make_strong_handle(MonoObject *p_object) { return mono_gchandle_new( p_object, false /* do not pin the object */ - ); + ); } uint32_t MonoGCHandle::make_weak_handle(MonoObject *p_object) { @@ -44,7 +44,7 @@ uint32_t MonoGCHandle::make_weak_handle(MonoObject *p_object) { return mono_gchandle_new_weakref( p_object, true /* track_resurrection: allows us to invoke _notification(NOTIFICATION_PREDELETE) while disposing */ - ); + ); } Ref<MonoGCHandle> MonoGCHandle::create_strong(MonoObject *p_object) { diff --git a/modules/mono/mono_gd/gd_mono_internals.cpp b/modules/mono/mono_gd/gd_mono_internals.cpp index cfe2148b80..56e8a01567 100644 --- a/modules/mono/mono_gd/gd_mono_internals.cpp +++ b/modules/mono/mono_gd/gd_mono_internals.cpp @@ -63,4 +63,4 @@ void tie_managed_to_unmanaged(MonoObject *managed, Object *unmanaged) { return; } -} +} // namespace GDMonoInternals diff --git a/modules/mono/signal_awaiter_utils.cpp b/modules/mono/signal_awaiter_utils.cpp index 7e99df29a1..47cc11cc0a 100644 --- a/modules/mono/signal_awaiter_utils.cpp +++ b/modules/mono/signal_awaiter_utils.cpp @@ -62,7 +62,7 @@ Error connect_signal_awaiter(Object *p_source, const String &p_signal, Object *p return err; } -} +} // namespace SignalAwaiterUtils Variant SignalAwaiterHandle::_signal_callback(const Variant **p_args, int p_argcount, Variant::CallError &r_error) { @@ -116,8 +116,8 @@ void SignalAwaiterHandle::_bind_methods() { ClassDB::bind_vararg_method(METHOD_FLAGS_DEFAULT, "_signal_callback", &SignalAwaiterHandle::_signal_callback, MethodInfo("_signal_callback")); } -SignalAwaiterHandle::SignalAwaiterHandle(uint32_t p_managed_handle) - : MonoGCHandle(p_managed_handle) { +SignalAwaiterHandle::SignalAwaiterHandle(uint32_t p_managed_handle) : + MonoGCHandle(p_managed_handle) { #ifdef DEBUG_ENABLED conn_target_id = 0; diff --git a/modules/mono/utils/mono_reg_utils.h b/modules/mono/utils/mono_reg_utils.h index 4cc4965acb..599828aa80 100644 --- a/modules/mono/utils/mono_reg_utils.h +++ b/modules/mono/utils/mono_reg_utils.h @@ -47,7 +47,7 @@ namespace MonoRegUtils { MonoRegInfo find_mono(); String find_msbuild_tools_path(); -} // MonoRegUtils +} // namespace MonoRegUtils #endif // WINDOWS_ENABLED diff --git a/modules/mono/utils/string_utils.cpp b/modules/mono/utils/string_utils.cpp index f26663ea11..8f817771ac 100644 --- a/modules/mono/utils/string_utils.cpp +++ b/modules/mono/utils/string_utils.cpp @@ -78,7 +78,7 @@ int sfind(const String &p_text, int p_from) { return -1; } -} +} // namespace String sformat(const String &p_text, const Variant &p1, const Variant &p2, const Variant &p3, const Variant &p4, const Variant &p5) { if (p_text.length() < 2) diff --git a/modules/opus/audio_stream_opus.cpp b/modules/opus/audio_stream_opus.cpp index 06eab4c94d..5742102dae 100644 --- a/modules/opus/audio_stream_opus.cpp +++ b/modules/opus/audio_stream_opus.cpp @@ -62,7 +62,7 @@ int AudioStreamPlaybackOpus::_op_seek_func(void *_stream, opus_int64 _offset, in fa->seek_end(_offset); } break; default: { - ERR_PRINT("BUG, wtf was whence set to?\n"); + ERR_PRINT("Opus seek function failure: Unexpected value in _whence\n"); } } int ret = fa->eof_reached() ? -1 : 0; diff --git a/modules/pvr/texture_loader_pvr.cpp b/modules/pvr/texture_loader_pvr.cpp index 03592047ad..4415c888a4 100644 --- a/modules/pvr/texture_loader_pvr.cpp +++ b/modules/pvr/texture_loader_pvr.cpp @@ -239,11 +239,11 @@ ResourceFormatPVR::ResourceFormatPVR() { Image::_image_compress_pvrtc2_func = _compress_pvrtc4; } -///////////////////////////////////////////////////////// + ///////////////////////////////////////////////////////// -//PVRTC decompressor, Based on PVRTC decompressor by IMGTEC. + //PVRTC decompressor, Based on PVRTC decompressor by IMGTEC. -///////////////////////////////////////////////////////// + ///////////////////////////////////////////////////////// #define PT_INDEX 2 #define BLK_Y_SIZE 4 diff --git a/modules/recast/SCsub b/modules/recast/SCsub index 500c0ec055..530df9a37c 100644 --- a/modules/recast/SCsub +++ b/modules/recast/SCsub @@ -24,7 +24,7 @@ if env['builtin_recast']: env.Append(CPPPATH=[thirdparty_dir, thirdparty_dir + "/Include"]) - lib = env.Library("recast_builtin", thirdparty_sources) + lib = env.add_library("recast_builtin", thirdparty_sources) env.Append(LIBS=[lib]) # Godot source files diff --git a/modules/regex/doc_classes/RegEx.xml b/modules/regex/doc_classes/RegEx.xml index 4cf272fe8c..8cd163b0c8 100644 --- a/modules/regex/doc_classes/RegEx.xml +++ b/modules/regex/doc_classes/RegEx.xml @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="UTF-8" ?> -<class name="RegEx" inherits="Reference" category="Core" version="3.0-alpha"> +<class name="RegEx" inherits="Reference" category="Core" version="3.0-beta"> <brief_description> Class for searching text for patterns using regular expressions. </brief_description> diff --git a/modules/regex/doc_classes/RegExMatch.xml b/modules/regex/doc_classes/RegExMatch.xml index 8c6951fea2..0217099ce6 100644 --- a/modules/regex/doc_classes/RegExMatch.xml +++ b/modules/regex/doc_classes/RegExMatch.xml @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="UTF-8" ?> -<class name="RegExMatch" inherits="Reference" category="Core" version="3.0-alpha"> +<class name="RegExMatch" inherits="Reference" category="Core" version="3.0-beta"> <brief_description> Contains the results of a regex search. </brief_description> diff --git a/modules/squish/image_compress_squish.cpp b/modules/squish/image_compress_squish.cpp index 072f18b990..ac436c3c26 100644 --- a/modules/squish/image_compress_squish.cpp +++ b/modules/squish/image_compress_squish.cpp @@ -64,7 +64,7 @@ void image_decompress_squish(Image *p_image) { } else if (p_image->get_format() == Image::FORMAT_RGTC_RG) { squish_flags = squish::kBc5; } else { - print_line("wtf askd to decompress.. " + itos(p_image->get_format())); + print_line("Can't decompress unknown format: " + itos(p_image->get_format())); ERR_FAIL_COND(true); return; } diff --git a/modules/stb_vorbis/doc_classes/AudioStreamOGGVorbis.xml b/modules/stb_vorbis/doc_classes/AudioStreamOGGVorbis.xml index ee6c28c36a..4533d59cae 100644 --- a/modules/stb_vorbis/doc_classes/AudioStreamOGGVorbis.xml +++ b/modules/stb_vorbis/doc_classes/AudioStreamOGGVorbis.xml @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="UTF-8" ?> -<class name="AudioStreamOGGVorbis" inherits="AudioStream" category="Core" version="3.0-alpha"> +<class name="AudioStreamOGGVorbis" inherits="AudioStream" category="Core" version="3.0-beta"> <brief_description> OGG Vorbis audio stream driver. </brief_description> @@ -54,17 +54,6 @@ </description> </method> </methods> - <members> - <member name="data" type="PoolByteArray" setter="set_data" getter="get_data"> - Raw audio data. - </member> - <member name="loop" type="bool" setter="set_loop" getter="has_loop"> - If [code]true[/code], audio will loop continuously. Default value: [code]false[/code]. - </member> - <member name="loop_offset" type="float" setter="set_loop_offset" getter="get_loop_offset"> - If loop is [code]true[/code], loop starts from this position, in seconds. - </member> - </members> <constants> </constants> </class> diff --git a/modules/stb_vorbis/doc_classes/ResourceImporterOGGVorbis.xml b/modules/stb_vorbis/doc_classes/ResourceImporterOGGVorbis.xml index ce16632d6e..9d541cda58 100644 --- a/modules/stb_vorbis/doc_classes/ResourceImporterOGGVorbis.xml +++ b/modules/stb_vorbis/doc_classes/ResourceImporterOGGVorbis.xml @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="UTF-8" ?> -<class name="ResourceImporterOGGVorbis" inherits="ResourceImporter" category="Core" version="3.0-alpha"> +<class name="ResourceImporterOGGVorbis" inherits="ResourceImporter" category="Core" version="3.0-beta"> <brief_description> </brief_description> <description> diff --git a/modules/svg/SCsub b/modules/svg/SCsub index 5be9367808..e12abac8c1 100644 --- a/modules/svg/SCsub +++ b/modules/svg/SCsub @@ -12,7 +12,8 @@ thirdparty_sources = [thirdparty_dir + file for file in thirdparty_sources] # env.add_source_files(env.modules_sources, thirdparty_sources) -lib = env.Library("svg_builtin", thirdparty_sources) +lib = env.add_library("svg_builtin", thirdparty_sources) + # Needs to be appended to arrive after libscene in the linker call, # but we don't want it to arrive *after* system libs, so manual hack # LIBS contains first SCons Library objects ("SCons.Node.FS.File object") diff --git a/modules/thekla_unwrap/SCsub b/modules/thekla_unwrap/SCsub new file mode 100644 index 0000000000..1d4b086848 --- /dev/null +++ b/modules/thekla_unwrap/SCsub @@ -0,0 +1,69 @@ +#!/usr/bin/env python + +Import('env') +Import('env_modules') + +env_thekla_unwrap = env_modules.Clone() + +# Thirdparty source files +if env['builtin_thekla_atlas']: + thirdparty_dir = "#thirdparty/thekla_atlas/" + thirdparty_sources = [ + "nvcore/Memory.cpp", + "nvcore/Debug.cpp", + "nvcore/StrLib.cpp", + "nvcore/FileSystem.cpp", + "nvcore/RadixSort.cpp", + "nvmath/Basis.cpp", + "nvmath/ConvexHull.cpp", + "nvmath/Fitting.cpp", + "nvmath/Plane.cpp", + "nvmath/ProximityGrid.cpp", + "nvmath/Random.cpp", + "nvmath/Solver.cpp", + "nvmath/Sparse.cpp", + "nvmath/TypeSerialization.cpp", + "poshlib/posh.c", + "nvimage/BitMap.cpp", + "nvimage/Image.cpp", + "nvmesh/BaseMesh.cpp", + "nvmesh/MeshBuilder.cpp", + "nvmesh/TriMesh.cpp", + "nvmesh/QuadTriMesh.cpp", + "nvmesh/MeshTopology.cpp", + "nvmesh/halfedge/Edge.cpp", + "nvmesh/halfedge/Mesh.cpp", + "nvmesh/halfedge/Face.cpp", + "nvmesh/halfedge/Vertex.cpp", + "nvmesh/geometry/Bounds.cpp", + "nvmesh/geometry/Measurements.cpp", + "nvmesh/raster/Raster.cpp", + "nvmesh/param/Atlas.cpp", + "nvmesh/param/AtlasBuilder.cpp", + "nvmesh/param/AtlasPacker.cpp", + "nvmesh/param/LeastSquaresConformalMap.cpp", + "nvmesh/param/OrthogonalProjectionMap.cpp", + "nvmesh/param/ParameterizationQuality.cpp", + "nvmesh/param/SingleFaceMap.cpp", + "nvmesh/param/Util.cpp", + "nvmesh/weld/VertexWeld.cpp", + "nvmesh/weld/Snap.cpp", + "thekla/thekla_atlas.cpp" + ] + thirdparty_sources = [thirdparty_dir + file for file in thirdparty_sources] + + env_thekla_unwrap.add_source_files(env.modules_sources, thirdparty_sources) + env_thekla_unwrap.Append(CPPPATH=[thirdparty_dir, thirdparty_dir + "/poshlib", thirdparty_dir + "/nvcore", thirdparty_dir + "/nvmesh"]) + + # upstream uses c++11 + env_thekla_unwrap.Append(CXXFLAGS="-std=gnu++11") + + if env["platform"] == 'x11': + env_thekla_unwrap.Append(CCFLAGS=["-DNV_OS_LINUX"]) + elif env["platform"] == 'osx': + env_thekla_unwrap.Append(CCFLAGS=["-DNV_OS_DARWIN"]) + elif env["platform"] == 'windows': + env_thekla_unwrap.Append(CCFLAGS=["-DNV_OS_WIN32"]) + +# Godot source files +env_thekla_unwrap.add_source_files(env.modules_sources, "*.cpp") diff --git a/modules/thekla_unwrap/config.py b/modules/thekla_unwrap/config.py new file mode 100644 index 0000000000..b1ce7d4b91 --- /dev/null +++ b/modules/thekla_unwrap/config.py @@ -0,0 +1,7 @@ +def can_build(platform): + return platform != "android" and platform != "ios" + +def configure(env): + if not env['tools']: + env['builtin_thekla_atlas'] = False + env.disabled_modules.append("thekla_unwrap") diff --git a/modules/thekla_unwrap/register_types.cpp b/modules/thekla_unwrap/register_types.cpp new file mode 100644 index 0000000000..01b834f8cb --- /dev/null +++ b/modules/thekla_unwrap/register_types.cpp @@ -0,0 +1,115 @@ +/*************************************************************************/ +/* register_types.cpp */ +/*************************************************************************/ +/* This file is part of: */ +/* GODOT ENGINE */ +/* https://godotengine.org */ +/*************************************************************************/ +/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */ +/* */ +/* Permission is hereby granted, free of charge, to any person obtaining */ +/* a copy of this software and associated documentation files (the */ +/* "Software"), to deal in the Software without restriction, including */ +/* without limitation the rights to use, copy, modify, merge, publish, */ +/* distribute, sublicense, and/or sell copies of the Software, and to */ +/* permit persons to whom the Software is furnished to do so, subject to */ +/* the following conditions: */ +/* */ +/* The above copyright notice and this permission notice shall be */ +/* included in all copies or substantial portions of the Software. */ +/* */ +/* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, */ +/* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF */ +/* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.*/ +/* IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY */ +/* CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, */ +/* TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE */ +/* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ +/*************************************************************************/ +#include "register_types.h" +#include "thirdparty/thekla_atlas/thekla/thekla_atlas.h" +#include <stdio.h> +#include <stdlib.h> +extern bool (*array_mesh_lightmap_unwrap_callback)(float p_texel_size, const float *p_vertices, const float *p_normals, int p_vertex_count, const int *p_indices, const int *p_face_materials, int p_index_count, float **r_uv, int **r_vertex, int *r_vertex_count, int **r_index, int *r_index_count, int *r_size_hint_x, int *r_size_hint_y); + +bool thekla_mesh_lightmap_unwrap_callback(float p_texel_size, const float *p_vertices, const float *p_normals, int p_vertex_count, const int *p_indices, const int *p_face_materials, int p_index_count, float **r_uv, int **r_vertex, int *r_vertex_count, int **r_index, int *r_index_count, int *r_size_hint_x, int *r_size_hint_y) { + + //set up input mesh + Thekla::Atlas_Input_Mesh input_mesh; + input_mesh.face_array = new Thekla::Atlas_Input_Face[p_index_count / 3]; + for (int i = 0; i < p_index_count / 3; i++) { + input_mesh.face_array[i].vertex_index[0] = p_indices[i * 3 + 0]; + input_mesh.face_array[i].vertex_index[1] = p_indices[i * 3 + 1]; + input_mesh.face_array[i].vertex_index[2] = p_indices[i * 3 + 2]; + printf("face %i - %i, %i, %i - mat %i\n", i, input_mesh.face_array[i].vertex_index[0], input_mesh.face_array[i].vertex_index[1], input_mesh.face_array[i].vertex_index[2], p_face_materials[i]); + input_mesh.face_array[i].material_index = p_face_materials[i]; + } + input_mesh.vertex_array = new Thekla::Atlas_Input_Vertex[p_vertex_count]; + for (int i = 0; i < p_vertex_count; i++) { + input_mesh.vertex_array[i].first_colocal = i; //wtf + for (int j = 0; j < 3; j++) { + input_mesh.vertex_array[i].position[j] = p_vertices[i * 3 + j]; + input_mesh.vertex_array[i].normal[j] = p_normals[i * 3 + j]; + } + input_mesh.vertex_array[i].uv[0] = 0; + input_mesh.vertex_array[i].uv[1] = 0; + printf("vertex %i - %f, %f, %f\n", i, input_mesh.vertex_array[i].position[0], input_mesh.vertex_array[i].position[1], input_mesh.vertex_array[i].position[2]); + printf("normal %i - %f, %f, %f\n", i, input_mesh.vertex_array[i].normal[0], input_mesh.vertex_array[i].normal[1], input_mesh.vertex_array[i].normal[2]); + } + input_mesh.face_count = p_index_count / 3; + input_mesh.vertex_count = p_vertex_count; + + //set up options + Thekla::Atlas_Options options; + Thekla::atlas_set_default_options(&options); + options.packer_options.witness.packing_quality = 1; + options.packer_options.witness.texel_area = 1.0 / p_texel_size; + + //generate + Thekla::Atlas_Error err; + Thekla::Atlas_Output_Mesh *output = atlas_generate(&input_mesh, &options, &err); + + delete[] input_mesh.face_array; + delete[] input_mesh.vertex_array; + + if (err != Thekla::Atlas_Error_Success) { + printf("error with atlas\n"); + } else { + *r_vertex = (int *)malloc(sizeof(int) * output->vertex_count); + *r_uv = (float *)malloc(sizeof(float) * output->vertex_count * 3); + *r_index = (int *)malloc(sizeof(int) * output->index_count); + + // printf("w: %i, h: %i\n", output->atlas_width, output->atlas_height); + for (int i = 0; i < output->vertex_count; i++) { + (*r_vertex)[i] = output->vertex_array[i].xref; + (*r_uv)[i * 2 + 0] = output->vertex_array[i].uv[0] / output->atlas_width; + (*r_uv)[i * 2 + 1] = output->vertex_array[i].uv[1] / output->atlas_height; + // printf("uv: %f,%f\n", (*r_uv)[i * 2 + 0], (*r_uv)[i * 2 + 1]); + } + *r_vertex_count = output->vertex_count; + + for (int i = 0; i < output->index_count; i++) { + (*r_index)[i] = output->index_array[i]; + } + + *r_index_count = output->index_count; + + *r_size_hint_x = output->atlas_height; + *r_size_hint_y = output->atlas_width; + } + + if (output) { + atlas_free(output); + } + + return err == Thekla::Atlas_Error_Success; +} + +void register_thekla_unwrap_types() { + + array_mesh_lightmap_unwrap_callback = thekla_mesh_lightmap_unwrap_callback; +} + +void unregister_thekla_unwrap_types() { +} diff --git a/modules/thekla_unwrap/register_types.h b/modules/thekla_unwrap/register_types.h new file mode 100644 index 0000000000..2bc3d16c64 --- /dev/null +++ b/modules/thekla_unwrap/register_types.h @@ -0,0 +1,31 @@ +/*************************************************************************/ +/* register_types.h */ +/*************************************************************************/ +/* This file is part of: */ +/* GODOT ENGINE */ +/* https://godotengine.org */ +/*************************************************************************/ +/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */ +/* */ +/* Permission is hereby granted, free of charge, to any person obtaining */ +/* a copy of this software and associated documentation files (the */ +/* "Software"), to deal in the Software without restriction, including */ +/* without limitation the rights to use, copy, modify, merge, publish, */ +/* distribute, sublicense, and/or sell copies of the Software, and to */ +/* permit persons to whom the Software is furnished to do so, subject to */ +/* the following conditions: */ +/* */ +/* The above copyright notice and this permission notice shall be */ +/* included in all copies or substantial portions of the Software. */ +/* */ +/* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, */ +/* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF */ +/* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.*/ +/* IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY */ +/* CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, */ +/* TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE */ +/* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ +/*************************************************************************/ +void register_thekla_unwrap_types(); +void unregister_thekla_unwrap_types(); diff --git a/modules/theora/doc_classes/ResourceImporterTheora.xml b/modules/theora/doc_classes/ResourceImporterTheora.xml index 497c938826..85c7c6bf89 100644 --- a/modules/theora/doc_classes/ResourceImporterTheora.xml +++ b/modules/theora/doc_classes/ResourceImporterTheora.xml @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="UTF-8" ?> -<class name="ResourceImporterTheora" inherits="ResourceImporter" category="Core" version="3.0-alpha"> +<class name="ResourceImporterTheora" inherits="ResourceImporter" category="Core" version="3.0-beta"> <brief_description> </brief_description> <description> diff --git a/modules/theora/doc_classes/VideoStreamTheora.xml b/modules/theora/doc_classes/VideoStreamTheora.xml index 8f155b786f..6c8806ed72 100644 --- a/modules/theora/doc_classes/VideoStreamTheora.xml +++ b/modules/theora/doc_classes/VideoStreamTheora.xml @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="UTF-8" ?> -<class name="VideoStreamTheora" inherits="VideoStream" category="Core" version="3.0-alpha"> +<class name="VideoStreamTheora" inherits="VideoStream" category="Core" version="3.0-beta"> <brief_description> </brief_description> <description> @@ -24,10 +24,6 @@ </description> </method> </methods> - <members> - <member name="file" type="String" setter="set_file" getter="get_file"> - </member> - </members> <constants> </constants> </class> diff --git a/modules/tinyexr/image_loader_tinyexr.cpp b/modules/tinyexr/image_loader_tinyexr.cpp index 49a4db237a..c88662454c 100644 --- a/modules/tinyexr/image_loader_tinyexr.cpp +++ b/modules/tinyexr/image_loader_tinyexr.cpp @@ -47,6 +47,11 @@ Error ImageLoaderTinyEXR::load_image(Ref<Image> p_image, FileAccess *f, bool p_f f->close(); + // Re-implementation of tinyexr's LoadEXRFromMemory using Godot types to store the Image data + // and Godot's error codes. + // When debugging after updating the thirdparty library, check that we're still in sync with + // their API usage in LoadEXRFromMemory. + EXRVersion exr_version; EXRImage exr_image; EXRHeader exr_header; @@ -68,6 +73,13 @@ Error ImageLoaderTinyEXR::load_image(Ref<Image> p_image, FileAccess *f, bool p_f return ERR_FILE_CORRUPT; } + // Read HALF channel as FLOAT. (GH-13490) + for (int i = 0; i < exr_header.num_channels; i++) { + if (exr_header.pixel_types[i] == TINYEXR_PIXELTYPE_HALF) { + exr_header.requested_pixel_types[i] = TINYEXR_PIXELTYPE_FLOAT; + } + } + InitEXRImage(&exr_image); ret = LoadEXRImageFromMemory(&exr_image, &exr_header, w.ptr(), src_image_len, &err); if (ret != TINYEXR_SUCCESS) { @@ -95,23 +107,25 @@ Error ImageLoaderTinyEXR::load_image(Ref<Image> p_image, FileAccess *f, bool p_f } if (idxR == -1) { - ERR_PRINT("R channel not found"); + ERR_PRINT("TinyEXR: R channel not found."); // @todo { free exr_image } return ERR_FILE_CORRUPT; } if (idxG == -1) { - ERR_PRINT("G channel not found\n") + ERR_PRINT("TinyEXR: G channel not found.") // @todo { free exr_image } return ERR_FILE_CORRUPT; } if (idxB == -1) { - ERR_PRINT("B channel not found\n") + ERR_PRINT("TinyEXR: B channel not found.") // @todo { free exr_image } return ERR_FILE_CORRUPT; } + // EXR image data loaded, now parse it into Godot-friendly image data + PoolVector<uint8_t> imgdata; Image::Format format; @@ -126,7 +140,6 @@ Error ImageLoaderTinyEXR::load_image(Ref<Image> p_image, FileAccess *f, bool p_f } { - PoolVector<uint8_t>::Write wd = imgdata.write(); uint16_t *iw = (uint16_t *)wd.ptr(); @@ -151,11 +164,13 @@ Error ImageLoaderTinyEXR::load_image(Ref<Image> p_image, FileAccess *f, bool p_f } } - print_line("EXR w: " + itos(exr_image.width) + " h:" + itos(exr_image.height) + " format " + Image::get_format_name(format)); p_image->create(exr_image.width, exr_image.height, false, format, imgdata); w = PoolVector<uint8_t>::Write(); + FreeEXRHeader(&exr_header); + FreeEXRImage(&exr_image); + return OK; } diff --git a/modules/visual_script/doc_classes/VisualScript.xml b/modules/visual_script/doc_classes/VisualScript.xml index 80b1ed86d7..46bd35dd73 100644 --- a/modules/visual_script/doc_classes/VisualScript.xml +++ b/modules/visual_script/doc_classes/VisualScript.xml @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="UTF-8" ?> -<class name="VisualScript" inherits="Script" category="Core" version="3.0-alpha"> +<class name="VisualScript" inherits="Script" category="Core" version="3.0-beta"> <brief_description> A script implemented in the Visual Script programming environment. </brief_description> @@ -495,10 +495,6 @@ </description> </method> </methods> - <members> - <member name="data" type="Dictionary" setter="_set_data" getter="_get_data"> - </member> - </members> <signals> <signal name="node_ports_changed"> <argument index="0" name="function" type="String"> diff --git a/modules/visual_script/doc_classes/VisualScriptBasicTypeConstant.xml b/modules/visual_script/doc_classes/VisualScriptBasicTypeConstant.xml index 6c028e5f28..e602214a66 100644 --- a/modules/visual_script/doc_classes/VisualScriptBasicTypeConstant.xml +++ b/modules/visual_script/doc_classes/VisualScriptBasicTypeConstant.xml @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="UTF-8" ?> -<class name="VisualScriptBasicTypeConstant" inherits="VisualScriptNode" category="Core" version="3.0-alpha"> +<class name="VisualScriptBasicTypeConstant" inherits="VisualScriptNode" category="Core" version="3.0-beta"> <brief_description> A Visual Script node representing a constant from the base types. </brief_description> @@ -11,34 +11,6 @@ <demos> </demos> <methods> - <method name="get_basic_type" qualifiers="const"> - <return type="int" enum="Variant.Type"> - </return> - <description> - </description> - </method> - <method name="get_basic_type_constant" qualifiers="const"> - <return type="String"> - </return> - <description> - </description> - </method> - <method name="set_basic_type"> - <return type="void"> - </return> - <argument index="0" name="name" type="int" enum="Variant.Type"> - </argument> - <description> - </description> - </method> - <method name="set_basic_type_constant"> - <return type="void"> - </return> - <argument index="0" name="name" type="String"> - </argument> - <description> - </description> - </method> </methods> <members> <member name="basic_type" type="int" setter="set_basic_type" getter="get_basic_type" enum="Variant.Type"> diff --git a/modules/visual_script/doc_classes/VisualScriptBuiltinFunc.xml b/modules/visual_script/doc_classes/VisualScriptBuiltinFunc.xml index c45c8d2b64..9f7d38e957 100644 --- a/modules/visual_script/doc_classes/VisualScriptBuiltinFunc.xml +++ b/modules/visual_script/doc_classes/VisualScriptBuiltinFunc.xml @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="UTF-8" ?> -<class name="VisualScriptBuiltinFunc" inherits="VisualScriptNode" category="Core" version="3.0-alpha"> +<class name="VisualScriptBuiltinFunc" inherits="VisualScriptNode" category="Core" version="3.0-beta"> <brief_description> A Visual Script node used to call built-in functions. </brief_description> @@ -12,20 +12,6 @@ <demos> </demos> <methods> - <method name="get_func"> - <return type="int" enum="VisualScriptBuiltinFunc.BuiltinFunc"> - </return> - <description> - </description> - </method> - <method name="set_func"> - <return type="void"> - </return> - <argument index="0" name="which" type="int" enum="VisualScriptBuiltinFunc.BuiltinFunc"> - </argument> - <description> - </description> - </method> </methods> <members> <member name="function" type="int" setter="set_func" getter="get_func" enum="VisualScriptBuiltinFunc.BuiltinFunc"> @@ -33,192 +19,192 @@ </member> </members> <constants> - <constant name="MATH_SIN" value="0"> + <constant name="MATH_SIN" value="0" enum="BuiltinFunc"> Return the sine of the input. </constant> - <constant name="MATH_COS" value="1"> + <constant name="MATH_COS" value="1" enum="BuiltinFunc"> Return the cosine of the input. </constant> - <constant name="MATH_TAN" value="2"> + <constant name="MATH_TAN" value="2" enum="BuiltinFunc"> Return the tangent of the input. </constant> - <constant name="MATH_SINH" value="3"> + <constant name="MATH_SINH" value="3" enum="BuiltinFunc"> Return the hyperbolic sine of the input. </constant> - <constant name="MATH_COSH" value="4"> + <constant name="MATH_COSH" value="4" enum="BuiltinFunc"> Return the hyperbolic cosine of the input. </constant> - <constant name="MATH_TANH" value="5"> + <constant name="MATH_TANH" value="5" enum="BuiltinFunc"> Return the hyperbolic tangent of the input. </constant> - <constant name="MATH_ASIN" value="6"> + <constant name="MATH_ASIN" value="6" enum="BuiltinFunc"> Return the arc sine of the input. </constant> - <constant name="MATH_ACOS" value="7"> + <constant name="MATH_ACOS" value="7" enum="BuiltinFunc"> Return the arc cosine of the input. </constant> - <constant name="MATH_ATAN" value="8"> + <constant name="MATH_ATAN" value="8" enum="BuiltinFunc"> Return the arc tangent of the input. </constant> - <constant name="MATH_ATAN2" value="9"> + <constant name="MATH_ATAN2" value="9" enum="BuiltinFunc"> Return the arc tangent of the input, using the signs of both parameters to determine the exact angle. </constant> - <constant name="MATH_SQRT" value="10"> + <constant name="MATH_SQRT" value="10" enum="BuiltinFunc"> Return the square root of the input. </constant> - <constant name="MATH_FMOD" value="11"> + <constant name="MATH_FMOD" value="11" enum="BuiltinFunc"> Return the remainder of one input divided by the other, using floating-point numbers. </constant> - <constant name="MATH_FPOSMOD" value="12"> + <constant name="MATH_FPOSMOD" value="12" enum="BuiltinFunc"> Return the positive remainder of one input divided by the other, using floating-point numbers. </constant> - <constant name="MATH_FLOOR" value="13"> + <constant name="MATH_FLOOR" value="13" enum="BuiltinFunc"> Return the input rounded down. </constant> - <constant name="MATH_CEIL" value="14"> + <constant name="MATH_CEIL" value="14" enum="BuiltinFunc"> Return the input rounded up. </constant> - <constant name="MATH_ROUND" value="15"> + <constant name="MATH_ROUND" value="15" enum="BuiltinFunc"> Return the input rounded to the nearest integer. </constant> - <constant name="MATH_ABS" value="16"> + <constant name="MATH_ABS" value="16" enum="BuiltinFunc"> Return the absolute value of the input. </constant> - <constant name="MATH_SIGN" value="17"> + <constant name="MATH_SIGN" value="17" enum="BuiltinFunc"> Return the sign of the input, turning it into 1, -1, or 0. Useful to determine if the input is positive or negative. </constant> - <constant name="MATH_POW" value="18"> + <constant name="MATH_POW" value="18" enum="BuiltinFunc"> Return the input raised to a given power. </constant> - <constant name="MATH_LOG" value="19"> + <constant name="MATH_LOG" value="19" enum="BuiltinFunc"> Return the natural logarithm of the input. Note that this is not the typical base-10 logarithm function calculators use. </constant> - <constant name="MATH_EXP" value="20"> + <constant name="MATH_EXP" value="20" enum="BuiltinFunc"> Return [b]e[/b] raised to the power of the input. [b]e[/b] sometimes called "Euler's number" is a mathematical constant whose value is approximately 2.71828. </constant> - <constant name="MATH_ISNAN" value="21"> + <constant name="MATH_ISNAN" value="21" enum="BuiltinFunc"> Return whether the input is NaN (Not a Number) or not. NaN is usually produced by dividing 0 by 0, though other ways exist. </constant> - <constant name="MATH_ISINF" value="22"> + <constant name="MATH_ISINF" value="22" enum="BuiltinFunc"> Return whether the input is an infinite floating-point number or not. Infinity is usually produced by dividing a number by 0, though other ways exist. </constant> - <constant name="MATH_EASE" value="23"> + <constant name="MATH_EASE" value="23" enum="BuiltinFunc"> Easing function, based on exponent. 0 is constant, 1 is linear, 0 to 1 is ease-in, 1+ is ease out. Negative values are in-out/out in. </constant> - <constant name="MATH_DECIMALS" value="24"> + <constant name="MATH_DECIMALS" value="24" enum="BuiltinFunc"> Return the number of digit places after the decimal that the first non-zero digit occurs. </constant> - <constant name="MATH_STEPIFY" value="25"> + <constant name="MATH_STEPIFY" value="25" enum="BuiltinFunc"> Return the input snapped to a given step. </constant> - <constant name="MATH_LERP" value="26"> + <constant name="MATH_LERP" value="26" enum="BuiltinFunc"> Return a number linearly interpolated between the first two inputs, based on the third input. Uses the formula [code]a + (a - b) * t[/code]. </constant> - <constant name="MATH_INVERSE_LERP" value="27"> + <constant name="MATH_INVERSE_LERP" value="27" enum="BuiltinFunc"> </constant> - <constant name="MATH_RANGE_LERP" value="28"> + <constant name="MATH_RANGE_LERP" value="28" enum="BuiltinFunc"> </constant> - <constant name="MATH_DECTIME" value="29"> + <constant name="MATH_DECTIME" value="29" enum="BuiltinFunc"> Return the result of 'value' decreased by 'step' * 'amount'. </constant> - <constant name="MATH_RANDOMIZE" value="30"> + <constant name="MATH_RANDOMIZE" value="30" enum="BuiltinFunc"> Randomize the seed (or the internal state) of the random number generator. Current implementation reseeds using a number based on time. </constant> - <constant name="MATH_RAND" value="31"> + <constant name="MATH_RAND" value="31" enum="BuiltinFunc"> Return a random 32 bits integer value. To obtain a random value between 0 to N (where N is smaller than 2^32 - 1), you can use it with the remainder function. </constant> - <constant name="MATH_RANDF" value="32"> + <constant name="MATH_RANDF" value="32" enum="BuiltinFunc"> Return a random floating-point value between 0 and 1. To obtain a random value between 0 to N, you can use it with multiplication. </constant> - <constant name="MATH_RANDOM" value="33"> + <constant name="MATH_RANDOM" value="33" enum="BuiltinFunc"> Return a random floating-point value between the two inputs. </constant> - <constant name="MATH_SEED" value="34"> + <constant name="MATH_SEED" value="34" enum="BuiltinFunc"> Set the seed for the random number generator. </constant> - <constant name="MATH_RANDSEED" value="35"> + <constant name="MATH_RANDSEED" value="35" enum="BuiltinFunc"> Return a random value from the given seed, along with the new seed. </constant> - <constant name="MATH_DEG2RAD" value="36"> + <constant name="MATH_DEG2RAD" value="36" enum="BuiltinFunc"> Convert the input from degrees to radians. </constant> - <constant name="MATH_RAD2DEG" value="37"> + <constant name="MATH_RAD2DEG" value="37" enum="BuiltinFunc"> Convert the input from radians to degrees. </constant> - <constant name="MATH_LINEAR2DB" value="38"> + <constant name="MATH_LINEAR2DB" value="38" enum="BuiltinFunc"> Convert the input from linear volume to decibel volume. </constant> - <constant name="MATH_DB2LINEAR" value="39"> + <constant name="MATH_DB2LINEAR" value="39" enum="BuiltinFunc"> Convert the input from decibel volume to linear volume. </constant> - <constant name="MATH_POLAR2CARTESIAN" value="40"> + <constant name="MATH_POLAR2CARTESIAN" value="40" enum="BuiltinFunc"> Converts a 2D point expressed in the polar coordinate system (a distance from the origin [code]r[/code] and an angle [code]th[/code]) to the cartesian coordinate system (x and y axis). </constant> - <constant name="MATH_CARTESIAN2POLAR" value="41"> + <constant name="MATH_CARTESIAN2POLAR" value="41" enum="BuiltinFunc"> Converts a 2D point expressed in the cartesian coordinate system (x and y axis) to the polar coordinate system (a distance from the origin and an angle). </constant> - <constant name="MATH_WRAP" value="42"> + <constant name="MATH_WRAP" value="42" enum="BuiltinFunc"> </constant> - <constant name="MATH_WRAPF" value="43"> + <constant name="MATH_WRAPF" value="43" enum="BuiltinFunc"> </constant> - <constant name="LOGIC_MAX" value="44"> + <constant name="LOGIC_MAX" value="44" enum="BuiltinFunc"> Return the greater of the two numbers, also known as their maximum. </constant> - <constant name="LOGIC_MIN" value="45"> + <constant name="LOGIC_MIN" value="45" enum="BuiltinFunc"> Return the lesser of the two numbers, also known as their minimum. </constant> - <constant name="LOGIC_CLAMP" value="46"> + <constant name="LOGIC_CLAMP" value="46" enum="BuiltinFunc"> Return the input clamped inside the given range, ensuring the result is never outside it. Equivalent to `min(max(input, range_low), range_high)` </constant> - <constant name="LOGIC_NEAREST_PO2" value="46"> + <constant name="LOGIC_NEAREST_PO2" value="47" enum="BuiltinFunc"> Return the nearest power of 2 to the input. </constant> - <constant name="OBJ_WEAKREF" value="47"> + <constant name="OBJ_WEAKREF" value="48" enum="BuiltinFunc"> Create a [WeakRef] from the input. </constant> - <constant name="FUNC_FUNCREF" value="48"> + <constant name="FUNC_FUNCREF" value="49" enum="BuiltinFunc"> Create a [FuncRef] from the input. </constant> - <constant name="TYPE_CONVERT" value="49"> + <constant name="TYPE_CONVERT" value="50" enum="BuiltinFunc"> Convert between types. </constant> - <constant name="TYPE_OF" value="50"> + <constant name="TYPE_OF" value="51" enum="BuiltinFunc"> Return the type of the input as an integer. Check [enum Variant.Type] for the integers that might be returned. </constant> - <constant name="TYPE_EXISTS" value="51"> + <constant name="TYPE_EXISTS" value="52" enum="BuiltinFunc"> Checks if a type is registered in the [ClassDB]. </constant> - <constant name="TEXT_CHAR" value="52"> + <constant name="TEXT_CHAR" value="53" enum="BuiltinFunc"> Return a character with the given ascii value. </constant> - <constant name="TEXT_STR" value="53"> + <constant name="TEXT_STR" value="54" enum="BuiltinFunc"> Convert the input to a string. </constant> - <constant name="TEXT_PRINT" value="54"> + <constant name="TEXT_PRINT" value="55" enum="BuiltinFunc"> Print the given string to the output window. </constant> - <constant name="TEXT_PRINTERR" value="55"> + <constant name="TEXT_PRINTERR" value="56" enum="BuiltinFunc"> Print the given string to the standard error output. </constant> - <constant name="TEXT_PRINTRAW" value="56"> + <constant name="TEXT_PRINTRAW" value="57" enum="BuiltinFunc"> Print the given string to the standard output, without adding a newline. </constant> - <constant name="VAR_TO_STR" value="57"> + <constant name="VAR_TO_STR" value="58" enum="BuiltinFunc"> Serialize a [Variant] to a string. </constant> - <constant name="STR_TO_VAR" value="58"> + <constant name="STR_TO_VAR" value="59" enum="BuiltinFunc"> Deserialize a [Variant] from a string serialized using [VAR_TO_STR]. </constant> - <constant name="VAR_TO_BYTES" value="59"> + <constant name="VAR_TO_BYTES" value="60" enum="BuiltinFunc"> Serialize a [Variant] to a [PoolByteArray]. </constant> - <constant name="BYTES_TO_VAR" value="60"> + <constant name="BYTES_TO_VAR" value="61" enum="BuiltinFunc"> Deserialize a [Variant] from a [PoolByteArray] serialized using [VAR_TO_BYTES]. </constant> - <constant name="COLORN" value="61"> + <constant name="COLORN" value="62" enum="BuiltinFunc"> Return the [Color] with the given name and alpha ranging from 0 to 1. Note: names are defined in color_names.inc. </constant> - <constant name="FUNC_MAX" value="62"> + <constant name="FUNC_MAX" value="63" enum="BuiltinFunc"> The maximum value the [member function] property can have. </constant> </constants> diff --git a/modules/visual_script/doc_classes/VisualScriptClassConstant.xml b/modules/visual_script/doc_classes/VisualScriptClassConstant.xml index e6498e92ad..78757843cd 100644 --- a/modules/visual_script/doc_classes/VisualScriptClassConstant.xml +++ b/modules/visual_script/doc_classes/VisualScriptClassConstant.xml @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="UTF-8" ?> -<class name="VisualScriptClassConstant" inherits="VisualScriptNode" category="Core" version="3.0-alpha"> +<class name="VisualScriptClassConstant" inherits="VisualScriptNode" category="Core" version="3.0-beta"> <brief_description> Gets a constant from a given class. </brief_description> @@ -15,34 +15,6 @@ <demos> </demos> <methods> - <method name="get_base_type"> - <return type="String"> - </return> - <description> - </description> - </method> - <method name="get_class_constant"> - <return type="String"> - </return> - <description> - </description> - </method> - <method name="set_base_type"> - <return type="void"> - </return> - <argument index="0" name="name" type="String"> - </argument> - <description> - </description> - </method> - <method name="set_class_constant"> - <return type="void"> - </return> - <argument index="0" name="name" type="String"> - </argument> - <description> - </description> - </method> </methods> <members> <member name="base_type" type="String" setter="set_base_type" getter="get_base_type"> diff --git a/modules/visual_script/doc_classes/VisualScriptComment.xml b/modules/visual_script/doc_classes/VisualScriptComment.xml index ea4545f8ef..c21a082362 100644 --- a/modules/visual_script/doc_classes/VisualScriptComment.xml +++ b/modules/visual_script/doc_classes/VisualScriptComment.xml @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="UTF-8" ?> -<class name="VisualScriptComment" inherits="VisualScriptNode" category="Core" version="3.0-alpha"> +<class name="VisualScriptComment" inherits="VisualScriptNode" category="Core" version="3.0-beta"> <brief_description> A Visual Script node used to annotate the script. </brief_description> @@ -12,48 +12,6 @@ <demos> </demos> <methods> - <method name="get_description" qualifiers="const"> - <return type="String"> - </return> - <description> - </description> - </method> - <method name="get_size" qualifiers="const"> - <return type="Vector2"> - </return> - <description> - </description> - </method> - <method name="get_title" qualifiers="const"> - <return type="String"> - </return> - <description> - </description> - </method> - <method name="set_description"> - <return type="void"> - </return> - <argument index="0" name="description" type="String"> - </argument> - <description> - </description> - </method> - <method name="set_size"> - <return type="void"> - </return> - <argument index="0" name="size" type="Vector2"> - </argument> - <description> - </description> - </method> - <method name="set_title"> - <return type="void"> - </return> - <argument index="0" name="title" type="String"> - </argument> - <description> - </description> - </method> </methods> <members> <member name="description" type="String" setter="set_description" getter="get_description"> diff --git a/modules/visual_script/doc_classes/VisualScriptCondition.xml b/modules/visual_script/doc_classes/VisualScriptCondition.xml index 2a30c604a5..f1f87c010d 100644 --- a/modules/visual_script/doc_classes/VisualScriptCondition.xml +++ b/modules/visual_script/doc_classes/VisualScriptCondition.xml @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="UTF-8" ?> -<class name="VisualScriptCondition" inherits="VisualScriptNode" category="Core" version="3.0-alpha"> +<class name="VisualScriptCondition" inherits="VisualScriptNode" category="Core" version="3.0-beta"> <brief_description> A Visual Script node which branches the flow. </brief_description> diff --git a/modules/visual_script/doc_classes/VisualScriptConstant.xml b/modules/visual_script/doc_classes/VisualScriptConstant.xml index 51c6d19238..39a1e5eba8 100644 --- a/modules/visual_script/doc_classes/VisualScriptConstant.xml +++ b/modules/visual_script/doc_classes/VisualScriptConstant.xml @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="UTF-8" ?> -<class name="VisualScriptConstant" inherits="VisualScriptNode" category="Core" version="3.0-alpha"> +<class name="VisualScriptConstant" inherits="VisualScriptNode" category="Core" version="3.0-beta"> <brief_description> Gets a contant's value. </brief_description> @@ -15,34 +15,6 @@ <demos> </demos> <methods> - <method name="get_constant_type" qualifiers="const"> - <return type="int" enum="Variant.Type"> - </return> - <description> - </description> - </method> - <method name="get_constant_value" qualifiers="const"> - <return type="Variant"> - </return> - <description> - </description> - </method> - <method name="set_constant_type"> - <return type="void"> - </return> - <argument index="0" name="type" type="int" enum="Variant.Type"> - </argument> - <description> - </description> - </method> - <method name="set_constant_value"> - <return type="void"> - </return> - <argument index="0" name="value" type="Variant"> - </argument> - <description> - </description> - </method> </methods> <members> <member name="type" type="int" setter="set_constant_type" getter="get_constant_type" enum="Variant.Type"> diff --git a/modules/visual_script/doc_classes/VisualScriptConstructor.xml b/modules/visual_script/doc_classes/VisualScriptConstructor.xml index 91df52e893..cbe8c6c096 100644 --- a/modules/visual_script/doc_classes/VisualScriptConstructor.xml +++ b/modules/visual_script/doc_classes/VisualScriptConstructor.xml @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="UTF-8" ?> -<class name="VisualScriptConstructor" inherits="VisualScriptNode" category="Core" version="3.0-alpha"> +<class name="VisualScriptConstructor" inherits="VisualScriptNode" category="Core" version="3.0-beta"> <brief_description> A Visual Script node which calls a base type constructor. </brief_description> @@ -40,30 +40,6 @@ </description> </method> </methods> - <members> - <member name="constructor" type="Dictionary" setter="set_constructor" getter="get_constructor"> - The constructor function's method info. Has roughly the following structure: - [codeblock] - { - name = "string", - args = [{ - name = "string" - class_name = "string" - type = TYPE_* - hint = PROPERTY_HINT_* - hint_string = "string" - }] - default_args = [] # Array of variants - flags = METHOD_FLAG_* - id = 0 - return = {type = TYPE_*} - } - [/codeblock] - </member> - <member name="type" type="int" setter="set_constructor_type" getter="get_constructor_type" enum="Variant.Type"> - The type to be constructed. - </member> - </members> <constants> </constants> </class> diff --git a/modules/visual_script/doc_classes/VisualScriptCustomNode.xml b/modules/visual_script/doc_classes/VisualScriptCustomNode.xml index 38c325cfb7..c321c616af 100644 --- a/modules/visual_script/doc_classes/VisualScriptCustomNode.xml +++ b/modules/visual_script/doc_classes/VisualScriptCustomNode.xml @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="UTF-8" ?> -<class name="VisualScriptCustomNode" inherits="VisualScriptNode" category="Core" version="3.0-alpha"> +<class name="VisualScriptCustomNode" inherits="VisualScriptNode" category="Core" version="3.0-beta"> <brief_description> A scripted Visual Script node. </brief_description> @@ -136,28 +136,28 @@ </method> </methods> <constants> - <constant name="START_MODE_BEGIN_SEQUENCE" value="0"> + <constant name="START_MODE_BEGIN_SEQUENCE" value="0" enum="StartMode"> The start mode used the first time when [method _step] is called. </constant> - <constant name="START_MODE_CONTINUE_SEQUENCE" value="1"> + <constant name="START_MODE_CONTINUE_SEQUENCE" value="1" enum="StartMode"> The start mode used when [method _step] is called after coming back from a STEP_PUSH_STACK_BIT. </constant> - <constant name="START_MODE_RESUME_YIELD" value="2"> + <constant name="START_MODE_RESUME_YIELD" value="2" enum="StartMode"> The start mode used when [method _step] is called after resuming from STEP_YIELD_BIT. </constant> - <constant name="STEP_PUSH_STACK_BIT" value="16777216" enum=""> + <constant name="STEP_PUSH_STACK_BIT" value="16777216"> Hint used by [method _step] to tell that control should return to it when there is no other node left to execute. This is used by [VisualScriptCondition] to redirect the sequence to the "Done" port after the true/false branch has finished execution. </constant> - <constant name="STEP_GO_BACK_BIT" value="33554432" enum=""> + <constant name="STEP_GO_BACK_BIT" value="33554432"> Hint used by [method _step] to tell that control should return back, either hitting a previous STEP_PUSH_STACK_BIT or exiting the function. </constant> - <constant name="STEP_NO_ADVANCE_BIT" value="67108864" enum=""> + <constant name="STEP_NO_ADVANCE_BIT" value="67108864"> </constant> - <constant name="STEP_EXIT_FUNCTION_BIT" value="134217728" enum=""> + <constant name="STEP_EXIT_FUNCTION_BIT" value="134217728"> Hint used by [method _step] to tell that control should stop and exit the function. </constant> - <constant name="STEP_YIELD_BIT" value="268435456" enum=""> + <constant name="STEP_YIELD_BIT" value="268435456"> Hint used by [method _step] to tell that the function should be yielded. Using this requires you to have at least one working memory slot, which is used for the [VisualScriptFunctionState]. </constant> diff --git a/modules/visual_script/doc_classes/VisualScriptDeconstruct.xml b/modules/visual_script/doc_classes/VisualScriptDeconstruct.xml index cbed3ba22c..0f396564e2 100644 --- a/modules/visual_script/doc_classes/VisualScriptDeconstruct.xml +++ b/modules/visual_script/doc_classes/VisualScriptDeconstruct.xml @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="UTF-8" ?> -<class name="VisualScriptDeconstruct" inherits="VisualScriptNode" category="Core" version="3.0-alpha"> +<class name="VisualScriptDeconstruct" inherits="VisualScriptNode" category="Core" version="3.0-beta"> <brief_description> A Visual Script node which deconstructs a base type instance into its parts. </brief_description> @@ -11,24 +11,8 @@ <demos> </demos> <methods> - <method name="get_deconstruct_type" qualifiers="const"> - <return type="int" enum="Variant.Type"> - </return> - <description> - </description> - </method> - <method name="set_deconstruct_type"> - <return type="void"> - </return> - <argument index="0" name="type" type="int" enum="Variant.Type"> - </argument> - <description> - </description> - </method> </methods> <members> - <member name="elem_cache" type="Array" setter="_set_elem_cache" getter="_get_elem_cache"> - </member> <member name="type" type="int" setter="set_deconstruct_type" getter="get_deconstruct_type" enum="Variant.Type"> The type to deconstruct. </member> diff --git a/modules/visual_script/doc_classes/VisualScriptEditor.xml b/modules/visual_script/doc_classes/VisualScriptEditor.xml index 70d52b2bd7..b433f132c1 100644 --- a/modules/visual_script/doc_classes/VisualScriptEditor.xml +++ b/modules/visual_script/doc_classes/VisualScriptEditor.xml @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="UTF-8" ?> -<class name="VisualScriptEditor" inherits="Object" category="Core" version="3.0.alpha.custom_build"> +<class name="VisualScriptEditor" inherits="Object" category="Core" version="3.0-beta"> <brief_description> </brief_description> <description> diff --git a/modules/visual_script/doc_classes/VisualScriptEmitSignal.xml b/modules/visual_script/doc_classes/VisualScriptEmitSignal.xml index 669276f0d0..71e8c7d93c 100644 --- a/modules/visual_script/doc_classes/VisualScriptEmitSignal.xml +++ b/modules/visual_script/doc_classes/VisualScriptEmitSignal.xml @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="UTF-8" ?> -<class name="VisualScriptEmitSignal" inherits="VisualScriptNode" category="Core" version="3.0-alpha"> +<class name="VisualScriptEmitSignal" inherits="VisualScriptNode" category="Core" version="3.0-beta"> <brief_description> Emits a specified signal. </brief_description> @@ -15,20 +15,6 @@ <demos> </demos> <methods> - <method name="get_signal" qualifiers="const"> - <return type="String"> - </return> - <description> - </description> - </method> - <method name="set_signal"> - <return type="void"> - </return> - <argument index="0" name="name" type="String"> - </argument> - <description> - </description> - </method> </methods> <members> <member name="signal" type="String" setter="set_signal" getter="get_signal"> diff --git a/modules/visual_script/doc_classes/VisualScriptEngineSingleton.xml b/modules/visual_script/doc_classes/VisualScriptEngineSingleton.xml index 6703ff4eda..b9f356412d 100644 --- a/modules/visual_script/doc_classes/VisualScriptEngineSingleton.xml +++ b/modules/visual_script/doc_classes/VisualScriptEngineSingleton.xml @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="UTF-8" ?> -<class name="VisualScriptEngineSingleton" inherits="VisualScriptNode" category="Core" version="3.0-alpha"> +<class name="VisualScriptEngineSingleton" inherits="VisualScriptNode" category="Core" version="3.0-beta"> <brief_description> A Visual Script node returning a singleton from [@GlobalScope] </brief_description> @@ -11,20 +11,6 @@ <demos> </demos> <methods> - <method name="get_singleton"> - <return type="String"> - </return> - <description> - </description> - </method> - <method name="set_singleton"> - <return type="void"> - </return> - <argument index="0" name="name" type="String"> - </argument> - <description> - </description> - </method> </methods> <members> <member name="constant" type="String" setter="set_singleton" getter="get_singleton"> diff --git a/modules/visual_script/doc_classes/VisualScriptExpression.xml b/modules/visual_script/doc_classes/VisualScriptExpression.xml index fb3b6ef19d..91c107e069 100644 --- a/modules/visual_script/doc_classes/VisualScriptExpression.xml +++ b/modules/visual_script/doc_classes/VisualScriptExpression.xml @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="UTF-8" ?> -<class name="VisualScriptExpression" inherits="VisualScriptNode" category="Core" version="3.0-alpha"> +<class name="VisualScriptExpression" inherits="VisualScriptNode" category="Core" version="3.0-beta"> <brief_description> </brief_description> <description> diff --git a/modules/visual_script/doc_classes/VisualScriptFunction.xml b/modules/visual_script/doc_classes/VisualScriptFunction.xml index d77169679b..2c63b98b22 100644 --- a/modules/visual_script/doc_classes/VisualScriptFunction.xml +++ b/modules/visual_script/doc_classes/VisualScriptFunction.xml @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="UTF-8" ?> -<class name="VisualScriptFunction" inherits="VisualScriptNode" category="Core" version="3.0-alpha"> +<class name="VisualScriptFunction" inherits="VisualScriptNode" category="Core" version="3.0-beta"> <brief_description> </brief_description> <description> diff --git a/modules/visual_script/doc_classes/VisualScriptFunctionCall.xml b/modules/visual_script/doc_classes/VisualScriptFunctionCall.xml index 7a0a7c9f55..03c47dca7c 100644 --- a/modules/visual_script/doc_classes/VisualScriptFunctionCall.xml +++ b/modules/visual_script/doc_classes/VisualScriptFunctionCall.xml @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="UTF-8" ?> -<class name="VisualScriptFunctionCall" inherits="VisualScriptNode" category="Core" version="3.0-alpha"> +<class name="VisualScriptFunctionCall" inherits="VisualScriptNode" category="Core" version="3.0-beta"> <brief_description> </brief_description> <description> @@ -9,150 +9,8 @@ <demos> </demos> <methods> - <method name="get_base_path" qualifiers="const"> - <return type="NodePath"> - </return> - <description> - </description> - </method> - <method name="get_base_script" qualifiers="const"> - <return type="String"> - </return> - <description> - </description> - </method> - <method name="get_base_type" qualifiers="const"> - <return type="String"> - </return> - <description> - </description> - </method> - <method name="get_basic_type" qualifiers="const"> - <return type="int" enum="Variant.Type"> - </return> - <description> - </description> - </method> - <method name="get_call_mode" qualifiers="const"> - <return type="int" enum="VisualScriptFunctionCall.CallMode"> - </return> - <description> - </description> - </method> - <method name="get_function" qualifiers="const"> - <return type="String"> - </return> - <description> - </description> - </method> - <method name="get_rpc_call_mode" qualifiers="const"> - <return type="int" enum="VisualScriptFunctionCall.RPCCallMode"> - </return> - <description> - </description> - </method> - <method name="get_singleton" qualifiers="const"> - <return type="String"> - </return> - <description> - </description> - </method> - <method name="get_use_default_args" qualifiers="const"> - <return type="int"> - </return> - <description> - </description> - </method> - <method name="get_validate" qualifiers="const"> - <return type="bool"> - </return> - <description> - </description> - </method> - <method name="set_base_path"> - <return type="void"> - </return> - <argument index="0" name="base_path" type="NodePath"> - </argument> - <description> - </description> - </method> - <method name="set_base_script"> - <return type="void"> - </return> - <argument index="0" name="base_script" type="String"> - </argument> - <description> - </description> - </method> - <method name="set_base_type"> - <return type="void"> - </return> - <argument index="0" name="base_type" type="String"> - </argument> - <description> - </description> - </method> - <method name="set_basic_type"> - <return type="void"> - </return> - <argument index="0" name="basic_type" type="int" enum="Variant.Type"> - </argument> - <description> - </description> - </method> - <method name="set_call_mode"> - <return type="void"> - </return> - <argument index="0" name="mode" type="int" enum="VisualScriptFunctionCall.CallMode"> - </argument> - <description> - </description> - </method> - <method name="set_function"> - <return type="void"> - </return> - <argument index="0" name="function" type="String"> - </argument> - <description> - </description> - </method> - <method name="set_rpc_call_mode"> - <return type="void"> - </return> - <argument index="0" name="mode" type="int" enum="VisualScriptFunctionCall.RPCCallMode"> - </argument> - <description> - </description> - </method> - <method name="set_singleton"> - <return type="void"> - </return> - <argument index="0" name="singleton" type="String"> - </argument> - <description> - </description> - </method> - <method name="set_use_default_args"> - <return type="void"> - </return> - <argument index="0" name="amount" type="int"> - </argument> - <description> - </description> - </method> - <method name="set_validate"> - <return type="void"> - </return> - <argument index="0" name="enable" type="bool"> - </argument> - <description> - </description> - </method> </methods> <members> - <member name="argument_cache" type="Dictionary" setter="_set_argument_cache" getter="_get_argument_cache"> - </member> <member name="base_script" type="String" setter="set_base_script" getter="get_base_script"> </member> <member name="base_type" type="String" setter="set_base_type" getter="get_base_type"> @@ -175,25 +33,25 @@ </member> </members> <constants> - <constant name="CALL_MODE_SELF" value="0"> + <constant name="CALL_MODE_SELF" value="0" enum="CallMode"> </constant> - <constant name="CALL_MODE_NODE_PATH" value="1"> + <constant name="CALL_MODE_NODE_PATH" value="1" enum="CallMode"> </constant> - <constant name="CALL_MODE_INSTANCE" value="2"> + <constant name="CALL_MODE_INSTANCE" value="2" enum="CallMode"> </constant> - <constant name="CALL_MODE_BASIC_TYPE" value="3"> + <constant name="CALL_MODE_BASIC_TYPE" value="3" enum="CallMode"> </constant> - <constant name="CALL_MODE_SINGLETON" value="4"> + <constant name="CALL_MODE_SINGLETON" value="4" enum="CallMode"> </constant> - <constant name="RPC_DISABLED" value="0"> + <constant name="RPC_DISABLED" value="0" enum="RPCCallMode"> </constant> - <constant name="RPC_RELIABLE" value="1"> + <constant name="RPC_RELIABLE" value="1" enum="RPCCallMode"> </constant> - <constant name="RPC_UNRELIABLE" value="2"> + <constant name="RPC_UNRELIABLE" value="2" enum="RPCCallMode"> </constant> - <constant name="RPC_RELIABLE_TO_ID" value="3"> + <constant name="RPC_RELIABLE_TO_ID" value="3" enum="RPCCallMode"> </constant> - <constant name="RPC_UNRELIABLE_TO_ID" value="4"> + <constant name="RPC_UNRELIABLE_TO_ID" value="4" enum="RPCCallMode"> </constant> </constants> </class> diff --git a/modules/visual_script/doc_classes/VisualScriptFunctionState.xml b/modules/visual_script/doc_classes/VisualScriptFunctionState.xml index 9b30f62236..90ec85e4f4 100644 --- a/modules/visual_script/doc_classes/VisualScriptFunctionState.xml +++ b/modules/visual_script/doc_classes/VisualScriptFunctionState.xml @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="UTF-8" ?> -<class name="VisualScriptFunctionState" inherits="Reference" category="Core" version="3.0-alpha"> +<class name="VisualScriptFunctionState" inherits="Reference" category="Core" version="3.0-beta"> <brief_description> </brief_description> <description> diff --git a/modules/visual_script/doc_classes/VisualScriptGlobalConstant.xml b/modules/visual_script/doc_classes/VisualScriptGlobalConstant.xml index 961244fe88..4417c8a533 100644 --- a/modules/visual_script/doc_classes/VisualScriptGlobalConstant.xml +++ b/modules/visual_script/doc_classes/VisualScriptGlobalConstant.xml @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="UTF-8" ?> -<class name="VisualScriptGlobalConstant" inherits="VisualScriptNode" category="Core" version="3.0-alpha"> +<class name="VisualScriptGlobalConstant" inherits="VisualScriptNode" category="Core" version="3.0-beta"> <brief_description> </brief_description> <description> @@ -9,20 +9,6 @@ <demos> </demos> <methods> - <method name="get_global_constant"> - <return type="int"> - </return> - <description> - </description> - </method> - <method name="set_global_constant"> - <return type="void"> - </return> - <argument index="0" name="index" type="int"> - </argument> - <description> - </description> - </method> </methods> <members> <member name="constant" type="int" setter="set_global_constant" getter="get_global_constant"> diff --git a/modules/visual_script/doc_classes/VisualScriptIndexGet.xml b/modules/visual_script/doc_classes/VisualScriptIndexGet.xml index c5229f7678..c0a83f186a 100644 --- a/modules/visual_script/doc_classes/VisualScriptIndexGet.xml +++ b/modules/visual_script/doc_classes/VisualScriptIndexGet.xml @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="UTF-8" ?> -<class name="VisualScriptIndexGet" inherits="VisualScriptNode" category="Core" version="3.0-alpha"> +<class name="VisualScriptIndexGet" inherits="VisualScriptNode" category="Core" version="3.0-beta"> <brief_description> </brief_description> <description> diff --git a/modules/visual_script/doc_classes/VisualScriptIndexSet.xml b/modules/visual_script/doc_classes/VisualScriptIndexSet.xml index 27646b4a5f..8661341919 100644 --- a/modules/visual_script/doc_classes/VisualScriptIndexSet.xml +++ b/modules/visual_script/doc_classes/VisualScriptIndexSet.xml @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="UTF-8" ?> -<class name="VisualScriptIndexSet" inherits="VisualScriptNode" category="Core" version="3.0-alpha"> +<class name="VisualScriptIndexSet" inherits="VisualScriptNode" category="Core" version="3.0-beta"> <brief_description> </brief_description> <description> diff --git a/modules/visual_script/doc_classes/VisualScriptInputAction.xml b/modules/visual_script/doc_classes/VisualScriptInputAction.xml index 7f6d13264e..afe72ba564 100644 --- a/modules/visual_script/doc_classes/VisualScriptInputAction.xml +++ b/modules/visual_script/doc_classes/VisualScriptInputAction.xml @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="UTF-8" ?> -<class name="VisualScriptInputAction" inherits="VisualScriptNode" category="Core" version="3.0-alpha"> +<class name="VisualScriptInputAction" inherits="VisualScriptNode" category="Core" version="3.0-beta"> <brief_description> </brief_description> <description> @@ -9,34 +9,6 @@ <demos> </demos> <methods> - <method name="get_action_mode" qualifiers="const"> - <return type="int" enum="VisualScriptInputAction.Mode"> - </return> - <description> - </description> - </method> - <method name="get_action_name" qualifiers="const"> - <return type="String"> - </return> - <description> - </description> - </method> - <method name="set_action_mode"> - <return type="void"> - </return> - <argument index="0" name="mode" type="int" enum="VisualScriptInputAction.Mode"> - </argument> - <description> - </description> - </method> - <method name="set_action_name"> - <return type="void"> - </return> - <argument index="0" name="name" type="String"> - </argument> - <description> - </description> - </method> </methods> <members> <member name="action" type="String" setter="set_action_name" getter="get_action_name"> @@ -45,13 +17,13 @@ </member> </members> <constants> - <constant name="MODE_PRESSED" value="0"> + <constant name="MODE_PRESSED" value="0" enum="Mode"> </constant> - <constant name="MODE_RELEASED" value="1"> + <constant name="MODE_RELEASED" value="1" enum="Mode"> </constant> - <constant name="MODE_JUST_PRESSED" value="2"> + <constant name="MODE_JUST_PRESSED" value="2" enum="Mode"> </constant> - <constant name="MODE_JUST_RELEASED" value="3"> + <constant name="MODE_JUST_RELEASED" value="3" enum="Mode"> </constant> </constants> </class> diff --git a/modules/visual_script/doc_classes/VisualScriptIterator.xml b/modules/visual_script/doc_classes/VisualScriptIterator.xml index fc905d6c39..08dfad5acb 100644 --- a/modules/visual_script/doc_classes/VisualScriptIterator.xml +++ b/modules/visual_script/doc_classes/VisualScriptIterator.xml @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="UTF-8" ?> -<class name="VisualScriptIterator" inherits="VisualScriptNode" category="Core" version="3.0-alpha"> +<class name="VisualScriptIterator" inherits="VisualScriptNode" category="Core" version="3.0-beta"> <brief_description> Steps through items in a given input. </brief_description> diff --git a/modules/visual_script/doc_classes/VisualScriptLocalVar.xml b/modules/visual_script/doc_classes/VisualScriptLocalVar.xml index ff77dfac0d..a4293adaae 100644 --- a/modules/visual_script/doc_classes/VisualScriptLocalVar.xml +++ b/modules/visual_script/doc_classes/VisualScriptLocalVar.xml @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="UTF-8" ?> -<class name="VisualScriptLocalVar" inherits="VisualScriptNode" category="Core" version="3.0-alpha"> +<class name="VisualScriptLocalVar" inherits="VisualScriptNode" category="Core" version="3.0-beta"> <brief_description> Gets a local variable's value. </brief_description> @@ -15,34 +15,6 @@ <demos> </demos> <methods> - <method name="get_var_name" qualifiers="const"> - <return type="String"> - </return> - <description> - </description> - </method> - <method name="get_var_type" qualifiers="const"> - <return type="int" enum="Variant.Type"> - </return> - <description> - </description> - </method> - <method name="set_var_name"> - <return type="void"> - </return> - <argument index="0" name="name" type="String"> - </argument> - <description> - </description> - </method> - <method name="set_var_type"> - <return type="void"> - </return> - <argument index="0" name="type" type="int" enum="Variant.Type"> - </argument> - <description> - </description> - </method> </methods> <members> <member name="type" type="int" setter="set_var_type" getter="get_var_type" enum="Variant.Type"> diff --git a/modules/visual_script/doc_classes/VisualScriptLocalVarSet.xml b/modules/visual_script/doc_classes/VisualScriptLocalVarSet.xml index 07b01d4576..c1a279bdb2 100644 --- a/modules/visual_script/doc_classes/VisualScriptLocalVarSet.xml +++ b/modules/visual_script/doc_classes/VisualScriptLocalVarSet.xml @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="UTF-8" ?> -<class name="VisualScriptLocalVarSet" inherits="VisualScriptNode" category="Core" version="3.0-alpha"> +<class name="VisualScriptLocalVarSet" inherits="VisualScriptNode" category="Core" version="3.0-beta"> <brief_description> Changes a local variable's value. </brief_description> @@ -17,34 +17,6 @@ <demos> </demos> <methods> - <method name="get_var_name" qualifiers="const"> - <return type="String"> - </return> - <description> - </description> - </method> - <method name="get_var_type" qualifiers="const"> - <return type="int" enum="Variant.Type"> - </return> - <description> - </description> - </method> - <method name="set_var_name"> - <return type="void"> - </return> - <argument index="0" name="name" type="String"> - </argument> - <description> - </description> - </method> - <method name="set_var_type"> - <return type="void"> - </return> - <argument index="0" name="type" type="int" enum="Variant.Type"> - </argument> - <description> - </description> - </method> </methods> <members> <member name="type" type="int" setter="set_var_type" getter="get_var_type" enum="Variant.Type"> diff --git a/modules/visual_script/doc_classes/VisualScriptMathConstant.xml b/modules/visual_script/doc_classes/VisualScriptMathConstant.xml index 817bcb5ce2..2cb053ee5f 100644 --- a/modules/visual_script/doc_classes/VisualScriptMathConstant.xml +++ b/modules/visual_script/doc_classes/VisualScriptMathConstant.xml @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="UTF-8" ?> -<class name="VisualScriptMathConstant" inherits="VisualScriptNode" category="Core" version="3.0-alpha"> +<class name="VisualScriptMathConstant" inherits="VisualScriptNode" category="Core" version="3.0-beta"> <brief_description> Commonly used mathematical constants. </brief_description> @@ -15,20 +15,6 @@ <demos> </demos> <methods> - <method name="get_math_constant"> - <return type="int" enum="VisualScriptMathConstant.MathConstant"> - </return> - <description> - </description> - </method> - <method name="set_math_constant"> - <return type="void"> - </return> - <argument index="0" name="which" type="int" enum="VisualScriptMathConstant.MathConstant"> - </argument> - <description> - </description> - </method> </methods> <members> <member name="constant" type="int" setter="set_math_constant" getter="get_math_constant" enum="VisualScriptMathConstant.MathConstant"> @@ -36,31 +22,31 @@ </member> </members> <constants> - <constant name="MATH_CONSTANT_ONE" value="0"> + <constant name="MATH_CONSTANT_ONE" value="0" enum="MathConstant"> Unity: [code]1[/code] </constant> - <constant name="MATH_CONSTANT_PI" value="1"> + <constant name="MATH_CONSTANT_PI" value="1" enum="MathConstant"> Pi: [code]3.141593[/code] </constant> - <constant name="MATH_CONSTANT_HALF_PI" value="2"> + <constant name="MATH_CONSTANT_HALF_PI" value="2" enum="MathConstant"> Pi divided by two: [code]1.570796[/code] </constant> - <constant name="MATH_CONSTANT_TAU" value="3"> + <constant name="MATH_CONSTANT_TAU" value="3" enum="MathConstant"> Tau: [code]6.283185[/code] </constant> - <constant name="MATH_CONSTANT_E" value="4"> + <constant name="MATH_CONSTANT_E" value="4" enum="MathConstant"> Natural log: [code]2.718282[/code] </constant> - <constant name="MATH_CONSTANT_SQRT2" value="5"> + <constant name="MATH_CONSTANT_SQRT2" value="5" enum="MathConstant"> Square root of two: [code]1.414214[/code] </constant> - <constant name="MATH_CONSTANT_INF" value="6"> + <constant name="MATH_CONSTANT_INF" value="6" enum="MathConstant"> Infinity: [code]inf[/code] </constant> - <constant name="MATH_CONSTANT_NAN" value="7"> + <constant name="MATH_CONSTANT_NAN" value="7" enum="MathConstant"> Not a number: [code]nan[/code] </constant> - <constant name="MATH_CONSTANT_MAX" value="8"> + <constant name="MATH_CONSTANT_MAX" value="8" enum="MathConstant"> </constant> </constants> </class> diff --git a/modules/visual_script/doc_classes/VisualScriptNode.xml b/modules/visual_script/doc_classes/VisualScriptNode.xml index f6f2867172..ef7cf7c3b8 100644 --- a/modules/visual_script/doc_classes/VisualScriptNode.xml +++ b/modules/visual_script/doc_classes/VisualScriptNode.xml @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="UTF-8" ?> -<class name="VisualScriptNode" inherits="Resource" category="Core" version="3.0-alpha"> +<class name="VisualScriptNode" inherits="Resource" category="Core" version="3.0-beta"> <brief_description> A node which is part of a [VisualScript]. </brief_description> @@ -46,10 +46,6 @@ </description> </method> </methods> - <members> - <member name="_default_input_values" type="Array" setter="_set_default_input_values" getter="_get_default_input_values"> - </member> - </members> <signals> <signal name="ports_changed"> <description> diff --git a/modules/visual_script/doc_classes/VisualScriptOperator.xml b/modules/visual_script/doc_classes/VisualScriptOperator.xml index bf4032c09c..b7819592d9 100644 --- a/modules/visual_script/doc_classes/VisualScriptOperator.xml +++ b/modules/visual_script/doc_classes/VisualScriptOperator.xml @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="UTF-8" ?> -<class name="VisualScriptOperator" inherits="VisualScriptNode" category="Core" version="3.0-alpha"> +<class name="VisualScriptOperator" inherits="VisualScriptNode" category="Core" version="3.0-beta"> <brief_description> </brief_description> <description> @@ -14,34 +14,6 @@ <demos> </demos> <methods> - <method name="get_operator" qualifiers="const"> - <return type="int" enum="Variant.Operator"> - </return> - <description> - </description> - </method> - <method name="get_typed" qualifiers="const"> - <return type="int" enum="Variant.Type"> - </return> - <description> - </description> - </method> - <method name="set_operator"> - <return type="void"> - </return> - <argument index="0" name="op" type="int" enum="Variant.Operator"> - </argument> - <description> - </description> - </method> - <method name="set_typed"> - <return type="void"> - </return> - <argument index="0" name="type" type="int" enum="Variant.Type"> - </argument> - <description> - </description> - </method> </methods> <members> <member name="operator" type="int" setter="set_operator" getter="get_operator" enum="Variant.Operator"> diff --git a/modules/visual_script/doc_classes/VisualScriptPreload.xml b/modules/visual_script/doc_classes/VisualScriptPreload.xml index 4a71e23809..712ec99fdb 100644 --- a/modules/visual_script/doc_classes/VisualScriptPreload.xml +++ b/modules/visual_script/doc_classes/VisualScriptPreload.xml @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="UTF-8" ?> -<class name="VisualScriptPreload" inherits="VisualScriptNode" category="Core" version="3.0-alpha"> +<class name="VisualScriptPreload" inherits="VisualScriptNode" category="Core" version="3.0-beta"> <brief_description> Creates a new [Resource] or loads one from the filesystem. </brief_description> @@ -15,20 +15,6 @@ <demos> </demos> <methods> - <method name="get_preload" qualifiers="const"> - <return type="Resource"> - </return> - <description> - </description> - </method> - <method name="set_preload"> - <return type="void"> - </return> - <argument index="0" name="resource" type="Resource"> - </argument> - <description> - </description> - </method> </methods> <members> <member name="resource" type="Resource" setter="set_preload" getter="get_preload"> diff --git a/modules/visual_script/doc_classes/VisualScriptPropertyGet.xml b/modules/visual_script/doc_classes/VisualScriptPropertyGet.xml index eb5c52f4be..11c50f2b97 100644 --- a/modules/visual_script/doc_classes/VisualScriptPropertyGet.xml +++ b/modules/visual_script/doc_classes/VisualScriptPropertyGet.xml @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="UTF-8" ?> -<class name="VisualScriptPropertyGet" inherits="VisualScriptNode" category="Core" version="3.0-alpha"> +<class name="VisualScriptPropertyGet" inherits="VisualScriptNode" category="Core" version="3.0-beta"> <brief_description> </brief_description> <description> @@ -9,104 +9,6 @@ <demos> </demos> <methods> - <method name="get_base_path" qualifiers="const"> - <return type="NodePath"> - </return> - <description> - </description> - </method> - <method name="get_base_script" qualifiers="const"> - <return type="String"> - </return> - <description> - </description> - </method> - <method name="get_base_type" qualifiers="const"> - <return type="String"> - </return> - <description> - </description> - </method> - <method name="get_basic_type" qualifiers="const"> - <return type="int" enum="Variant.Type"> - </return> - <description> - </description> - </method> - <method name="get_call_mode" qualifiers="const"> - <return type="int" enum="VisualScriptPropertyGet.CallMode"> - </return> - <description> - </description> - </method> - <method name="get_index" qualifiers="const"> - <return type="String"> - </return> - <description> - </description> - </method> - <method name="get_property" qualifiers="const"> - <return type="String"> - </return> - <description> - </description> - </method> - <method name="set_base_path"> - <return type="void"> - </return> - <argument index="0" name="base_path" type="NodePath"> - </argument> - <description> - </description> - </method> - <method name="set_base_script"> - <return type="void"> - </return> - <argument index="0" name="base_script" type="String"> - </argument> - <description> - </description> - </method> - <method name="set_base_type"> - <return type="void"> - </return> - <argument index="0" name="base_type" type="String"> - </argument> - <description> - </description> - </method> - <method name="set_basic_type"> - <return type="void"> - </return> - <argument index="0" name="basic_type" type="int" enum="Variant.Type"> - </argument> - <description> - </description> - </method> - <method name="set_call_mode"> - <return type="void"> - </return> - <argument index="0" name="mode" type="int" enum="VisualScriptPropertyGet.CallMode"> - </argument> - <description> - </description> - </method> - <method name="set_index"> - <return type="void"> - </return> - <argument index="0" name="index" type="String"> - </argument> - <description> - </description> - </method> - <method name="set_property"> - <return type="void"> - </return> - <argument index="0" name="property" type="String"> - </argument> - <description> - </description> - </method> </methods> <members> <member name="base_script" type="String" setter="set_base_script" getter="get_base_script"> @@ -123,15 +25,13 @@ </member> <member name="set_mode" type="int" setter="set_call_mode" getter="get_call_mode" enum="VisualScriptPropertyGet.CallMode"> </member> - <member name="type_cache" type="int" setter="_set_type_cache" getter="_get_type_cache" enum="Variant.Type"> - </member> </members> <constants> - <constant name="CALL_MODE_SELF" value="0"> + <constant name="CALL_MODE_SELF" value="0" enum="CallMode"> </constant> - <constant name="CALL_MODE_NODE_PATH" value="1"> + <constant name="CALL_MODE_NODE_PATH" value="1" enum="CallMode"> </constant> - <constant name="CALL_MODE_INSTANCE" value="2"> + <constant name="CALL_MODE_INSTANCE" value="2" enum="CallMode"> </constant> </constants> </class> diff --git a/modules/visual_script/doc_classes/VisualScriptPropertySet.xml b/modules/visual_script/doc_classes/VisualScriptPropertySet.xml index 794caa2518..2e96ccc1f6 100644 --- a/modules/visual_script/doc_classes/VisualScriptPropertySet.xml +++ b/modules/visual_script/doc_classes/VisualScriptPropertySet.xml @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="UTF-8" ?> -<class name="VisualScriptPropertySet" inherits="VisualScriptNode" category="Core" version="3.0-alpha"> +<class name="VisualScriptPropertySet" inherits="VisualScriptNode" category="Core" version="3.0-beta"> <brief_description> </brief_description> <description> @@ -9,118 +9,6 @@ <demos> </demos> <methods> - <method name="get_assign_op" qualifiers="const"> - <return type="int" enum="VisualScriptPropertySet.AssignOp"> - </return> - <description> - </description> - </method> - <method name="get_base_path" qualifiers="const"> - <return type="NodePath"> - </return> - <description> - </description> - </method> - <method name="get_base_script" qualifiers="const"> - <return type="String"> - </return> - <description> - </description> - </method> - <method name="get_base_type" qualifiers="const"> - <return type="String"> - </return> - <description> - </description> - </method> - <method name="get_basic_type" qualifiers="const"> - <return type="int" enum="Variant.Type"> - </return> - <description> - </description> - </method> - <method name="get_call_mode" qualifiers="const"> - <return type="int" enum="VisualScriptPropertySet.CallMode"> - </return> - <description> - </description> - </method> - <method name="get_index" qualifiers="const"> - <return type="String"> - </return> - <description> - </description> - </method> - <method name="get_property" qualifiers="const"> - <return type="String"> - </return> - <description> - </description> - </method> - <method name="set_assign_op"> - <return type="void"> - </return> - <argument index="0" name="assign_op" type="int" enum="VisualScriptPropertySet.AssignOp"> - </argument> - <description> - </description> - </method> - <method name="set_base_path"> - <return type="void"> - </return> - <argument index="0" name="base_path" type="NodePath"> - </argument> - <description> - </description> - </method> - <method name="set_base_script"> - <return type="void"> - </return> - <argument index="0" name="base_script" type="String"> - </argument> - <description> - </description> - </method> - <method name="set_base_type"> - <return type="void"> - </return> - <argument index="0" name="base_type" type="String"> - </argument> - <description> - </description> - </method> - <method name="set_basic_type"> - <return type="void"> - </return> - <argument index="0" name="basic_type" type="int" enum="Variant.Type"> - </argument> - <description> - </description> - </method> - <method name="set_call_mode"> - <return type="void"> - </return> - <argument index="0" name="mode" type="int" enum="VisualScriptPropertySet.CallMode"> - </argument> - <description> - </description> - </method> - <method name="set_index"> - <return type="void"> - </return> - <argument index="0" name="index" type="String"> - </argument> - <description> - </description> - </method> - <method name="set_property"> - <return type="void"> - </return> - <argument index="0" name="property" type="String"> - </argument> - <description> - </description> - </method> </methods> <members> <member name="assign_op" type="int" setter="set_assign_op" getter="get_assign_op" enum="VisualScriptPropertySet.AssignOp"> @@ -139,39 +27,37 @@ </member> <member name="set_mode" type="int" setter="set_call_mode" getter="get_call_mode" enum="VisualScriptPropertySet.CallMode"> </member> - <member name="type_cache" type="Dictionary" setter="_set_type_cache" getter="_get_type_cache"> - </member> </members> <constants> - <constant name="CALL_MODE_SELF" value="0"> + <constant name="CALL_MODE_SELF" value="0" enum="CallMode"> </constant> - <constant name="CALL_MODE_NODE_PATH" value="1"> + <constant name="CALL_MODE_NODE_PATH" value="1" enum="CallMode"> </constant> - <constant name="CALL_MODE_INSTANCE" value="2"> + <constant name="CALL_MODE_INSTANCE" value="2" enum="CallMode"> </constant> - <constant name="CALL_MODE_BASIC_TYPE" value="3"> + <constant name="CALL_MODE_BASIC_TYPE" value="3" enum="CallMode"> </constant> - <constant name="ASSIGN_OP_NONE" value="0"> + <constant name="ASSIGN_OP_NONE" value="0" enum="AssignOp"> </constant> - <constant name="ASSIGN_OP_ADD" value="1"> + <constant name="ASSIGN_OP_ADD" value="1" enum="AssignOp"> </constant> - <constant name="ASSIGN_OP_SUB" value="2"> + <constant name="ASSIGN_OP_SUB" value="2" enum="AssignOp"> </constant> - <constant name="ASSIGN_OP_MUL" value="3"> + <constant name="ASSIGN_OP_MUL" value="3" enum="AssignOp"> </constant> - <constant name="ASSIGN_OP_DIV" value="4"> + <constant name="ASSIGN_OP_DIV" value="4" enum="AssignOp"> </constant> - <constant name="ASSIGN_OP_MOD" value="5"> + <constant name="ASSIGN_OP_MOD" value="5" enum="AssignOp"> </constant> - <constant name="ASSIGN_OP_SHIFT_LEFT" value="6"> + <constant name="ASSIGN_OP_SHIFT_LEFT" value="6" enum="AssignOp"> </constant> - <constant name="ASSIGN_OP_SHIFT_RIGHT" value="7"> + <constant name="ASSIGN_OP_SHIFT_RIGHT" value="7" enum="AssignOp"> </constant> - <constant name="ASSIGN_OP_BIT_AND" value="8"> + <constant name="ASSIGN_OP_BIT_AND" value="8" enum="AssignOp"> </constant> - <constant name="ASSIGN_OP_BIT_OR" value="9"> + <constant name="ASSIGN_OP_BIT_OR" value="9" enum="AssignOp"> </constant> - <constant name="ASSIGN_OP_BIT_XOR" value="10"> + <constant name="ASSIGN_OP_BIT_XOR" value="10" enum="AssignOp"> </constant> </constants> </class> diff --git a/modules/visual_script/doc_classes/VisualScriptResourcePath.xml b/modules/visual_script/doc_classes/VisualScriptResourcePath.xml index 274a852c3e..36bcf2a460 100644 --- a/modules/visual_script/doc_classes/VisualScriptResourcePath.xml +++ b/modules/visual_script/doc_classes/VisualScriptResourcePath.xml @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="UTF-8" ?> -<class name="VisualScriptResourcePath" inherits="VisualScriptNode" category="Core" version="3.0-alpha"> +<class name="VisualScriptResourcePath" inherits="VisualScriptNode" category="Core" version="3.0-beta"> <brief_description> </brief_description> <description> @@ -9,20 +9,6 @@ <demos> </demos> <methods> - <method name="get_resource_path"> - <return type="String"> - </return> - <description> - </description> - </method> - <method name="set_resource_path"> - <return type="void"> - </return> - <argument index="0" name="path" type="String"> - </argument> - <description> - </description> - </method> </methods> <members> <member name="path" type="String" setter="set_resource_path" getter="get_resource_path"> diff --git a/modules/visual_script/doc_classes/VisualScriptReturn.xml b/modules/visual_script/doc_classes/VisualScriptReturn.xml index 4ac586a02c..a05c1076a4 100644 --- a/modules/visual_script/doc_classes/VisualScriptReturn.xml +++ b/modules/visual_script/doc_classes/VisualScriptReturn.xml @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="UTF-8" ?> -<class name="VisualScriptReturn" inherits="VisualScriptNode" category="Core" version="3.0-alpha"> +<class name="VisualScriptReturn" inherits="VisualScriptNode" category="Core" version="3.0-beta"> <brief_description> Exits a function and returns an optional value. </brief_description> @@ -16,34 +16,6 @@ <demos> </demos> <methods> - <method name="get_return_type" qualifiers="const"> - <return type="int" enum="Variant.Type"> - </return> - <description> - </description> - </method> - <method name="is_return_value_enabled" qualifiers="const"> - <return type="bool"> - </return> - <description> - </description> - </method> - <method name="set_enable_return_value"> - <return type="void"> - </return> - <argument index="0" name="enable" type="bool"> - </argument> - <description> - </description> - </method> - <method name="set_return_type"> - <return type="void"> - </return> - <argument index="0" name="type" type="int" enum="Variant.Type"> - </argument> - <description> - </description> - </method> </methods> <members> <member name="return_enabled" type="bool" setter="set_enable_return_value" getter="is_return_value_enabled"> diff --git a/modules/visual_script/doc_classes/VisualScriptSceneNode.xml b/modules/visual_script/doc_classes/VisualScriptSceneNode.xml index e8fdb69c6a..1a73faaf67 100644 --- a/modules/visual_script/doc_classes/VisualScriptSceneNode.xml +++ b/modules/visual_script/doc_classes/VisualScriptSceneNode.xml @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="UTF-8" ?> -<class name="VisualScriptSceneNode" inherits="VisualScriptNode" category="Core" version="3.0-alpha"> +<class name="VisualScriptSceneNode" inherits="VisualScriptNode" category="Core" version="3.0-beta"> <brief_description> Node reference. </brief_description> @@ -15,20 +15,6 @@ <demos> </demos> <methods> - <method name="get_node_path"> - <return type="NodePath"> - </return> - <description> - </description> - </method> - <method name="set_node_path"> - <return type="void"> - </return> - <argument index="0" name="path" type="NodePath"> - </argument> - <description> - </description> - </method> </methods> <members> <member name="node_path" type="NodePath" setter="set_node_path" getter="get_node_path"> diff --git a/modules/visual_script/doc_classes/VisualScriptSceneTree.xml b/modules/visual_script/doc_classes/VisualScriptSceneTree.xml index e74c330623..25ae9c26ac 100644 --- a/modules/visual_script/doc_classes/VisualScriptSceneTree.xml +++ b/modules/visual_script/doc_classes/VisualScriptSceneTree.xml @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="UTF-8" ?> -<class name="VisualScriptSceneTree" inherits="VisualScriptNode" category="Core" version="3.0-alpha"> +<class name="VisualScriptSceneTree" inherits="VisualScriptNode" category="Core" version="3.0-beta"> <brief_description> </brief_description> <description> diff --git a/modules/visual_script/doc_classes/VisualScriptSelect.xml b/modules/visual_script/doc_classes/VisualScriptSelect.xml index 6a62e364f3..45ac505110 100644 --- a/modules/visual_script/doc_classes/VisualScriptSelect.xml +++ b/modules/visual_script/doc_classes/VisualScriptSelect.xml @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="UTF-8" ?> -<class name="VisualScriptSelect" inherits="VisualScriptNode" category="Core" version="3.0-alpha"> +<class name="VisualScriptSelect" inherits="VisualScriptNode" category="Core" version="3.0-beta"> <brief_description> Chooses between two input values. </brief_description> @@ -17,20 +17,6 @@ <demos> </demos> <methods> - <method name="get_typed" qualifiers="const"> - <return type="int" enum="Variant.Type"> - </return> - <description> - </description> - </method> - <method name="set_typed"> - <return type="void"> - </return> - <argument index="0" name="type" type="int" enum="Variant.Type"> - </argument> - <description> - </description> - </method> </methods> <members> <member name="type" type="int" setter="set_typed" getter="get_typed" enum="Variant.Type"> diff --git a/modules/visual_script/doc_classes/VisualScriptSelf.xml b/modules/visual_script/doc_classes/VisualScriptSelf.xml index f39a02bf84..2b0c46a4bb 100644 --- a/modules/visual_script/doc_classes/VisualScriptSelf.xml +++ b/modules/visual_script/doc_classes/VisualScriptSelf.xml @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="UTF-8" ?> -<class name="VisualScriptSelf" inherits="VisualScriptNode" category="Core" version="3.0-alpha"> +<class name="VisualScriptSelf" inherits="VisualScriptNode" category="Core" version="3.0-beta"> <brief_description> Outputs a reference to the current instance. </brief_description> diff --git a/modules/visual_script/doc_classes/VisualScriptSequence.xml b/modules/visual_script/doc_classes/VisualScriptSequence.xml index 51238070d5..624663b0d3 100644 --- a/modules/visual_script/doc_classes/VisualScriptSequence.xml +++ b/modules/visual_script/doc_classes/VisualScriptSequence.xml @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="UTF-8" ?> -<class name="VisualScriptSequence" inherits="VisualScriptNode" category="Core" version="3.0-alpha"> +<class name="VisualScriptSequence" inherits="VisualScriptNode" category="Core" version="3.0-beta"> <brief_description> Executes a series of Sequence ports. </brief_description> @@ -17,20 +17,6 @@ <demos> </demos> <methods> - <method name="get_steps" qualifiers="const"> - <return type="int"> - </return> - <description> - </description> - </method> - <method name="set_steps"> - <return type="void"> - </return> - <argument index="0" name="steps" type="int"> - </argument> - <description> - </description> - </method> </methods> <members> <member name="steps" type="int" setter="set_steps" getter="get_steps"> diff --git a/modules/visual_script/doc_classes/VisualScriptSubCall.xml b/modules/visual_script/doc_classes/VisualScriptSubCall.xml index 381095f49b..b7dc5ad65f 100644 --- a/modules/visual_script/doc_classes/VisualScriptSubCall.xml +++ b/modules/visual_script/doc_classes/VisualScriptSubCall.xml @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="UTF-8" ?> -<class name="VisualScriptSubCall" inherits="VisualScriptNode" category="Core" version="3.0-alpha"> +<class name="VisualScriptSubCall" inherits="VisualScriptNode" category="Core" version="3.0-beta"> <brief_description> </brief_description> <description> diff --git a/modules/visual_script/doc_classes/VisualScriptSwitch.xml b/modules/visual_script/doc_classes/VisualScriptSwitch.xml index 3c8a79f686..a34754b596 100644 --- a/modules/visual_script/doc_classes/VisualScriptSwitch.xml +++ b/modules/visual_script/doc_classes/VisualScriptSwitch.xml @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="UTF-8" ?> -<class name="VisualScriptSwitch" inherits="VisualScriptNode" category="Core" version="3.0-alpha"> +<class name="VisualScriptSwitch" inherits="VisualScriptNode" category="Core" version="3.0-beta"> <brief_description> Branches program flow based on a given input's value. </brief_description> diff --git a/modules/visual_script/doc_classes/VisualScriptTypeCast.xml b/modules/visual_script/doc_classes/VisualScriptTypeCast.xml index 417c0a5159..e61e81c397 100644 --- a/modules/visual_script/doc_classes/VisualScriptTypeCast.xml +++ b/modules/visual_script/doc_classes/VisualScriptTypeCast.xml @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="UTF-8" ?> -<class name="VisualScriptTypeCast" inherits="VisualScriptNode" category="Core" version="3.0-alpha"> +<class name="VisualScriptTypeCast" inherits="VisualScriptNode" category="Core" version="3.0-beta"> <brief_description> </brief_description> <description> @@ -9,34 +9,6 @@ <demos> </demos> <methods> - <method name="get_base_script" qualifiers="const"> - <return type="String"> - </return> - <description> - </description> - </method> - <method name="get_base_type" qualifiers="const"> - <return type="String"> - </return> - <description> - </description> - </method> - <method name="set_base_script"> - <return type="void"> - </return> - <argument index="0" name="path" type="String"> - </argument> - <description> - </description> - </method> - <method name="set_base_type"> - <return type="void"> - </return> - <argument index="0" name="type" type="String"> - </argument> - <description> - </description> - </method> </methods> <members> <member name="base_script" type="String" setter="set_base_script" getter="get_base_script"> diff --git a/modules/visual_script/doc_classes/VisualScriptVariableGet.xml b/modules/visual_script/doc_classes/VisualScriptVariableGet.xml index 1cad4480a6..7122d2d3f6 100644 --- a/modules/visual_script/doc_classes/VisualScriptVariableGet.xml +++ b/modules/visual_script/doc_classes/VisualScriptVariableGet.xml @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="UTF-8" ?> -<class name="VisualScriptVariableGet" inherits="VisualScriptNode" category="Core" version="3.0-alpha"> +<class name="VisualScriptVariableGet" inherits="VisualScriptNode" category="Core" version="3.0-beta"> <brief_description> Gets a variable's value. </brief_description> @@ -15,20 +15,6 @@ <demos> </demos> <methods> - <method name="get_variable" qualifiers="const"> - <return type="String"> - </return> - <description> - </description> - </method> - <method name="set_variable"> - <return type="void"> - </return> - <argument index="0" name="name" type="String"> - </argument> - <description> - </description> - </method> </methods> <members> <member name="var_name" type="String" setter="set_variable" getter="get_variable"> diff --git a/modules/visual_script/doc_classes/VisualScriptVariableSet.xml b/modules/visual_script/doc_classes/VisualScriptVariableSet.xml index fa3befa21d..3c39da0a8d 100644 --- a/modules/visual_script/doc_classes/VisualScriptVariableSet.xml +++ b/modules/visual_script/doc_classes/VisualScriptVariableSet.xml @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="UTF-8" ?> -<class name="VisualScriptVariableSet" inherits="VisualScriptNode" category="Core" version="3.0-alpha"> +<class name="VisualScriptVariableSet" inherits="VisualScriptNode" category="Core" version="3.0-beta"> <brief_description> Changes a variable's value. </brief_description> @@ -16,20 +16,6 @@ <demos> </demos> <methods> - <method name="get_variable" qualifiers="const"> - <return type="String"> - </return> - <description> - </description> - </method> - <method name="set_variable"> - <return type="void"> - </return> - <argument index="0" name="name" type="String"> - </argument> - <description> - </description> - </method> </methods> <members> <member name="var_name" type="String" setter="set_variable" getter="get_variable"> diff --git a/modules/visual_script/doc_classes/VisualScriptWhile.xml b/modules/visual_script/doc_classes/VisualScriptWhile.xml index f948660997..d8e59a7576 100644 --- a/modules/visual_script/doc_classes/VisualScriptWhile.xml +++ b/modules/visual_script/doc_classes/VisualScriptWhile.xml @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="UTF-8" ?> -<class name="VisualScriptWhile" inherits="VisualScriptNode" category="Core" version="3.0-alpha"> +<class name="VisualScriptWhile" inherits="VisualScriptNode" category="Core" version="3.0-beta"> <brief_description> Conditional loop. </brief_description> diff --git a/modules/visual_script/doc_classes/VisualScriptYield.xml b/modules/visual_script/doc_classes/VisualScriptYield.xml index 5474ee8b78..72ef586c1f 100644 --- a/modules/visual_script/doc_classes/VisualScriptYield.xml +++ b/modules/visual_script/doc_classes/VisualScriptYield.xml @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="UTF-8" ?> -<class name="VisualScriptYield" inherits="VisualScriptNode" category="Core" version="3.0-alpha"> +<class name="VisualScriptYield" inherits="VisualScriptNode" category="Core" version="3.0-beta"> <brief_description> </brief_description> <description> @@ -9,26 +9,12 @@ <demos> </demos> <methods> - <method name="get_wait_time"> - <return type="float"> - </return> - <description> - </description> - </method> <method name="get_yield_mode"> <return type="int" enum="VisualScriptYield.YieldMode"> </return> <description> </description> </method> - <method name="set_wait_time"> - <return type="void"> - </return> - <argument index="0" name="sec" type="float"> - </argument> - <description> - </description> - </method> <method name="set_yield_mode"> <return type="void"> </return> @@ -39,17 +25,15 @@ </method> </methods> <members> - <member name="mode" type="int" setter="set_yield_mode" getter="get_yield_mode" enum="VisualScriptYield.YieldMode"> - </member> <member name="wait_time" type="float" setter="set_wait_time" getter="get_wait_time"> </member> </members> <constants> - <constant name="YIELD_FRAME" value="1"> + <constant name="YIELD_FRAME" value="1" enum="YieldMode"> </constant> - <constant name="YIELD_PHYSICS_FRAME" value="2"> + <constant name="YIELD_PHYSICS_FRAME" value="2" enum="YieldMode"> </constant> - <constant name="YIELD_WAIT" value="3"> + <constant name="YIELD_WAIT" value="3" enum="YieldMode"> </constant> </constants> </class> diff --git a/modules/visual_script/doc_classes/VisualScriptYieldSignal.xml b/modules/visual_script/doc_classes/VisualScriptYieldSignal.xml index a3b6982075..f69043a685 100644 --- a/modules/visual_script/doc_classes/VisualScriptYieldSignal.xml +++ b/modules/visual_script/doc_classes/VisualScriptYieldSignal.xml @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="UTF-8" ?> -<class name="VisualScriptYieldSignal" inherits="VisualScriptNode" category="Core" version="3.0-alpha"> +<class name="VisualScriptYieldSignal" inherits="VisualScriptNode" category="Core" version="3.0-beta"> <brief_description> </brief_description> <description> @@ -9,62 +9,6 @@ <demos> </demos> <methods> - <method name="get_base_path" qualifiers="const"> - <return type="NodePath"> - </return> - <description> - </description> - </method> - <method name="get_base_type" qualifiers="const"> - <return type="String"> - </return> - <description> - </description> - </method> - <method name="get_call_mode" qualifiers="const"> - <return type="int" enum="VisualScriptYieldSignal.CallMode"> - </return> - <description> - </description> - </method> - <method name="get_signal" qualifiers="const"> - <return type="String"> - </return> - <description> - </description> - </method> - <method name="set_base_path"> - <return type="void"> - </return> - <argument index="0" name="base_path" type="NodePath"> - </argument> - <description> - </description> - </method> - <method name="set_base_type"> - <return type="void"> - </return> - <argument index="0" name="base_type" type="String"> - </argument> - <description> - </description> - </method> - <method name="set_call_mode"> - <return type="void"> - </return> - <argument index="0" name="mode" type="int" enum="VisualScriptYieldSignal.CallMode"> - </argument> - <description> - </description> - </method> - <method name="set_signal"> - <return type="void"> - </return> - <argument index="0" name="signal" type="String"> - </argument> - <description> - </description> - </method> </methods> <members> <member name="base_type" type="String" setter="set_base_type" getter="get_base_type"> @@ -77,11 +21,11 @@ </member> </members> <constants> - <constant name="CALL_MODE_SELF" value="0"> + <constant name="CALL_MODE_SELF" value="0" enum="CallMode"> </constant> - <constant name="CALL_MODE_NODE_PATH" value="1"> + <constant name="CALL_MODE_NODE_PATH" value="1" enum="CallMode"> </constant> - <constant name="CALL_MODE_INSTANCE" value="2"> + <constant name="CALL_MODE_INSTANCE" value="2" enum="CallMode"> </constant> </constants> </class> diff --git a/modules/visual_script/register_types.cpp b/modules/visual_script/register_types.cpp index b6ce10381d..ecdca7eb42 100644 --- a/modules/visual_script/register_types.cpp +++ b/modules/visual_script/register_types.cpp @@ -53,7 +53,7 @@ void register_visual_script_types() { ClassDB::register_class<VisualScript>(); ClassDB::register_virtual_class<VisualScriptNode>(); - ClassDB::register_virtual_class<VisualScriptFunctionState>(); + ClassDB::register_class<VisualScriptFunctionState>(); ClassDB::register_class<VisualScriptFunction>(); ClassDB::register_class<VisualScriptOperator>(); ClassDB::register_class<VisualScriptVariableSet>(); diff --git a/modules/visual_script/visual_script.cpp b/modules/visual_script/visual_script.cpp index 0834bc81d9..53d93798d9 100644 --- a/modules/visual_script/visual_script.cpp +++ b/modules/visual_script/visual_script.cpp @@ -1434,7 +1434,7 @@ void VisualScriptInstance::_dependency_step(VisualScriptNodeInstance *node, int if (!node->dependencies.empty()) { int dc = node->dependencies.size(); - VisualScriptNodeInstance **deps = node->dependencies.ptr(); + VisualScriptNodeInstance **deps = node->dependencies.ptrw(); for (int i = 0; i < dc; i++) { @@ -1526,7 +1526,7 @@ Variant VisualScriptInstance::_call_internal(const StringName &p_method, void *p if (!node->dependencies.empty()) { int dc = node->dependencies.size(); - VisualScriptNodeInstance **deps = node->dependencies.ptr(); + VisualScriptNodeInstance **deps = node->dependencies.ptrw(); for (int i = 0; i < dc; i++) { @@ -1626,7 +1626,7 @@ Variant VisualScriptInstance::_call_internal(const StringName &p_method, void *p state->flow_stack_pos = flow_stack_pos; state->stack.resize(p_stack_size); state->pass = p_pass; - copymem(state->stack.ptr(), p_stack, p_stack_size); + copymem(state->stack.ptrw(), p_stack, p_stack_size); //step 2, run away, return directly r_error.error = Variant::CallError::CALL_OK; @@ -2047,6 +2047,7 @@ void VisualScriptInstance::create(const Ref<VisualScript> &p_script, Object *p_o function.argument_count = func_node->get_argument_count(); function.max_stack += function.argument_count; function.flow_stack_size = func_node->is_stack_less() ? 0 : func_node->get_stack_size(); + max_input_args = MAX(max_input_args, function.argument_count); } //multiple passes are required to set up this complex thing.. @@ -2277,7 +2278,7 @@ Variant VisualScriptFunctionState::_signal_callback(const Variant **p_args, int *working_mem = args; //arguments go to working mem. - Variant ret = instance->_call_internal(function, stack.ptr(), stack.size(), node, flow_stack_pos, pass, true, r_error); + Variant ret = instance->_call_internal(function, stack.ptrw(), stack.size(), node, flow_stack_pos, pass, true, r_error); function = StringName(); //invalidate return ret; } @@ -2289,7 +2290,7 @@ void VisualScriptFunctionState::connect_to_signal(Object *p_obj, const String &p binds.push_back(p_binds[i]); } binds.push_back(Ref<VisualScriptFunctionState>(this)); //add myself on the back to avoid dying from unreferencing - p_obj->connect(p_signal, this, "_signal_callback", binds); + p_obj->connect(p_signal, this, "_signal_callback", binds, CONNECT_ONESHOT); } bool VisualScriptFunctionState::is_valid() const { @@ -2319,7 +2320,7 @@ Variant VisualScriptFunctionState::resume(Array p_args) { *working_mem = p_args; //arguments go to working mem. - Variant ret = instance->_call_internal(function, stack.ptr(), stack.size(), node, flow_stack_pos, pass, true, r_error); + Variant ret = instance->_call_internal(function, stack.ptrw(), stack.size(), node, flow_stack_pos, pass, true, r_error); function = StringName(); //invalidate return ret; } diff --git a/modules/visual_script/visual_script_editor.cpp b/modules/visual_script/visual_script_editor.cpp index 83b8d8da2d..6c58de8a5a 100644 --- a/modules/visual_script/visual_script_editor.cpp +++ b/modules/visual_script/visual_script_editor.cpp @@ -1389,7 +1389,7 @@ bool VisualScriptEditor::can_drop_data_fw(const Point2 &p_point, const Variant & if (String(d["type"]) == "obj_property") { #ifdef OSX_ENABLED - const_cast<VisualScriptEditor *>(this)->_show_hint(TTR("Hold Meta to drop a Getter. Hold Shift to drop a generic signature.")); + const_cast<VisualScriptEditor *>(this)->_show_hint(vformat(TTR("Hold %s to drop a Getter. Hold Shift to drop a generic signature."), find_keycode_name(KEY_META))); #else const_cast<VisualScriptEditor *>(this)->_show_hint(TTR("Hold Ctrl to drop a Getter. Hold Shift to drop a generic signature.")); #endif @@ -1398,7 +1398,7 @@ bool VisualScriptEditor::can_drop_data_fw(const Point2 &p_point, const Variant & if (String(d["type"]) == "nodes") { #ifdef OSX_ENABLED - const_cast<VisualScriptEditor *>(this)->_show_hint(TTR("Hold Meta to drop a simple reference to the node.")); + const_cast<VisualScriptEditor *>(this)->_show_hint(vformat(TTR("Hold %s to drop a simple reference to the node."), find_keycode_name(KEY_META))); #else const_cast<VisualScriptEditor *>(this)->_show_hint(TTR("Hold Ctrl to drop a simple reference to the node.")); #endif @@ -1407,7 +1407,7 @@ bool VisualScriptEditor::can_drop_data_fw(const Point2 &p_point, const Variant & if (String(d["type"]) == "visual_script_variable_drag") { #ifdef OSX_ENABLED - const_cast<VisualScriptEditor *>(this)->_show_hint(TTR("Hold Meta to drop a Variable Setter.")); + const_cast<VisualScriptEditor *>(this)->_show_hint(vformat(TTR("Hold %s to drop a Variable Setter."), find_keycode_name(KEY_META))); #else const_cast<VisualScriptEditor *>(this)->_show_hint(TTR("Hold Ctrl to drop a Variable Setter.")); #endif @@ -2466,7 +2466,7 @@ VisualScriptNode::TypeGuess VisualScriptEditor::_guess_output_type(int p_port_ac in_guesses.push_back(g); } - return node->guess_output_type(in_guesses.ptr(), p_port_action_output); + return node->guess_output_type(in_guesses.ptrw(), p_port_action_output); } void VisualScriptEditor::_port_action_menu(int p_option) { diff --git a/modules/visual_script/visual_script_expression.cpp b/modules/visual_script/visual_script_expression.cpp index 07dca4b904..ba58a8e1c0 100644 --- a/modules/visual_script/visual_script_expression.cpp +++ b/modules/visual_script/visual_script_expression.cpp @@ -1378,7 +1378,7 @@ public: argp[i] = &arr[i]; } - r_ret = Variant::construct(constructor->data_type, argp.ptr(), argp.size(), ce); + r_ret = Variant::construct(constructor->data_type, (const Variant **)argp.ptr(), argp.size(), ce); if (ce.error != Variant::CallError::CALL_OK) { r_error_str = "Invalid arguments to construct '" + Variant::get_type_name(constructor->data_type) + "'."; @@ -1405,7 +1405,7 @@ public: argp[i] = &arr[i]; } - VisualScriptBuiltinFunc::exec_func(bifunc->func, argp.ptr(), &r_ret, ce, r_error_str); + VisualScriptBuiltinFunc::exec_func(bifunc->func, (const Variant **)argp.ptr(), &r_ret, ce, r_error_str); if (ce.error != Variant::CallError::CALL_OK) { r_error_str = "Builtin Call Failed. " + r_error_str; @@ -1437,7 +1437,7 @@ public: argp[i] = &arr[i]; } - r_ret = base.call(call->method, argp.ptr(), argp.size(), ce); + r_ret = base.call(call->method, (const Variant **)argp.ptr(), argp.size(), ce); if (ce.error != Variant::CallError::CALL_OK) { r_error_str = "On call to '" + String(call->method) + "':"; diff --git a/modules/visual_script/visual_script_flow_control.cpp b/modules/visual_script/visual_script_flow_control.cpp index 59d9540239..a38266acc0 100644 --- a/modules/visual_script/visual_script_flow_control.cpp +++ b/modules/visual_script/visual_script_flow_control.cpp @@ -731,9 +731,9 @@ void VisualScriptSwitch::_bind_methods() { VisualScriptSwitch::VisualScriptSwitch() { } -////////////////////////////////////////// -////////////////EVENT ACTION FILTER/////////// -////////////////////////////////////////// + ////////////////////////////////////////// + ////////////////EVENT ACTION FILTER/////////// + ////////////////////////////////////////// #if 0 int VisualScriptInputFilter::get_output_sequence_port_count() const { diff --git a/modules/visual_script/visual_script_nodes.cpp b/modules/visual_script/visual_script_nodes.cpp index 05ff629d1b..5f98951bec 100644 --- a/modules/visual_script/visual_script_nodes.cpp +++ b/modules/visual_script/visual_script_nodes.cpp @@ -390,7 +390,7 @@ PropertyInfo VisualScriptOperator::get_input_value_port_info(int p_idx) const { { Variant::NIL, Variant::NIL }, //OP_GREATER_EQUAL, //mathematic { Variant::NIL, Variant::NIL }, //OP_ADD, - { Variant::NIL, Variant::NIL }, //OP_SUBSTRACT, + { Variant::NIL, Variant::NIL }, //OP_SUBTRACT, { Variant::NIL, Variant::NIL }, //OP_MULTIPLY, { Variant::NIL, Variant::NIL }, //OP_DIVIDE, { Variant::NIL, Variant::NIL }, //OP_NEGATE, @@ -433,7 +433,7 @@ PropertyInfo VisualScriptOperator::get_output_value_port_info(int p_idx) const { Variant::BOOL, //OP_GREATER_EQUAL, //mathematic Variant::NIL, //OP_ADD, - Variant::NIL, //OP_SUBSTRACT, + Variant::NIL, //OP_SUBTRACT, Variant::NIL, //OP_MULTIPLY, Variant::NIL, //OP_DIVIDE, Variant::NIL, //OP_NEGATE, @@ -474,7 +474,7 @@ static const char *op_names[] = { "GreaterEq", //OP_GREATER_EQUAL, //mathematic "Add", //OP_ADD, - "Subtract", //OP_SUBSTRACT, + "Subtract", //OP_SUBTRACT, "Multiply", //OP_MULTIPLY, "Divide", //OP_DIVIDE, "Negate", //OP_NEGATE, @@ -514,7 +514,7 @@ String VisualScriptOperator::get_text() const { L"A \u2265 B", //OP_GREATER_EQUAL, //mathematic L"A + B", //OP_ADD, - L"A - B", //OP_SUBSTRACT, + L"A - B", //OP_SUBTRACT, L"A x B", //OP_MULTIPLY, L"A \u00F7 B", //OP_DIVIDE, L"\u00AC A", //OP_NEGATE, @@ -1064,9 +1064,9 @@ void VisualScriptConstant::set_constant_type(Variant::Type p_type) { return; type = p_type; - ports_changed_notify(); Variant::CallError ce; value = Variant::construct(type, NULL, 0, ce); + ports_changed_notify(); _change_notify(); } @@ -1111,7 +1111,7 @@ void VisualScriptConstant::_bind_methods() { } ADD_PROPERTY(PropertyInfo(Variant::INT, "type", PROPERTY_HINT_ENUM, argt), "set_constant_type", "get_constant_type"); - ADD_PROPERTY(PropertyInfo(Variant::NIL, "value", PROPERTY_HINT_NONE, "", PROPERTY_USAGE_NIL_IS_VARIANT), "set_constant_value", "get_constant_value"); + ADD_PROPERTY(PropertyInfo(Variant::NIL, "value", PROPERTY_HINT_NONE, "", PROPERTY_USAGE_NIL_IS_VARIANT | PROPERTY_USAGE_DEFAULT), "set_constant_value", "get_constant_value"); } class VisualScriptNodeInstanceConstant : public VisualScriptNodeInstance { diff --git a/modules/vorbis/audio_stream_ogg_vorbis.cpp b/modules/vorbis/audio_stream_ogg_vorbis.cpp index 9fb6fa8197..03c0bfb1c2 100644 --- a/modules/vorbis/audio_stream_ogg_vorbis.cpp +++ b/modules/vorbis/audio_stream_ogg_vorbis.cpp @@ -64,7 +64,7 @@ int AudioStreamPlaybackOGGVorbis::_ov_seek_func(void *_f, ogg_int64_t offs, int fa->seek_end(offs); } else { - ERR_PRINT("BUG, wtf was whence set to?\n"); + ERR_PRINT("Vorbis seek function failure: Unexpected value in _whence\n"); } int ret = fa->eof_reached() ? -1 : 0; //printf("returning %i\n",ret); diff --git a/modules/webm/doc_classes/ResourceImporterWebm.xml b/modules/webm/doc_classes/ResourceImporterWebm.xml index dcba351e37..5dadb83b07 100644 --- a/modules/webm/doc_classes/ResourceImporterWebm.xml +++ b/modules/webm/doc_classes/ResourceImporterWebm.xml @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="UTF-8" ?> -<class name="ResourceImporterWebm" inherits="ResourceImporter" category="Core" version="3.0-alpha"> +<class name="ResourceImporterWebm" inherits="ResourceImporter" category="Core" version="3.0-beta"> <brief_description> </brief_description> <description> diff --git a/modules/webm/doc_classes/VideoStreamWebm.xml b/modules/webm/doc_classes/VideoStreamWebm.xml index 9a430f6b0d..6e8120b1de 100644 --- a/modules/webm/doc_classes/VideoStreamWebm.xml +++ b/modules/webm/doc_classes/VideoStreamWebm.xml @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="UTF-8" ?> -<class name="VideoStreamWebm" inherits="VideoStream" category="Core" version="3.0-alpha"> +<class name="VideoStreamWebm" inherits="VideoStream" category="Core" version="3.0-beta"> <brief_description> </brief_description> <description> @@ -24,10 +24,6 @@ </description> </method> </methods> - <members> - <member name="file" type="String" setter="set_file" getter="get_file"> - </member> - </members> <constants> </constants> </class> diff --git a/modules/webm/video_stream_webm.cpp b/modules/webm/video_stream_webm.cpp index 0fc9df5b58..b055ccf5aa 100644 --- a/modules/webm/video_stream_webm.cpp +++ b/modules/webm/video_stream_webm.cpp @@ -92,21 +92,27 @@ private: /**/ -VideoStreamPlaybackWebm::VideoStreamPlaybackWebm() - : audio_track(0), - webm(NULL), - video(NULL), - audio(NULL), - video_frames(NULL), audio_frame(NULL), - video_frames_pos(0), video_frames_capacity(0), - num_decoded_samples(0), samples_offset(-1), - mix_callback(NULL), - mix_udata(NULL), - playing(false), paused(false), - delay_compensation(0.0), - time(0.0), video_frame_delay(0.0), video_pos(0.0), - texture(memnew(ImageTexture)), - pcm(NULL) {} +VideoStreamPlaybackWebm::VideoStreamPlaybackWebm() : + audio_track(0), + webm(NULL), + video(NULL), + audio(NULL), + video_frames(NULL), + audio_frame(NULL), + video_frames_pos(0), + video_frames_capacity(0), + num_decoded_samples(0), + samples_offset(-1), + mix_callback(NULL), + mix_udata(NULL), + playing(false), + paused(false), + delay_compensation(0.0), + time(0.0), + video_frame_delay(0.0), + video_pos(0.0), + texture(memnew(ImageTexture)), + pcm(NULL) {} VideoStreamPlaybackWebm::~VideoStreamPlaybackWebm() { delete_pointers(); @@ -403,8 +409,8 @@ void VideoStreamPlaybackWebm::delete_pointers() { /**/ -VideoStreamWebm::VideoStreamWebm() - : audio_track(0) {} +VideoStreamWebm::VideoStreamWebm() : + audio_track(0) {} Ref<VideoStreamPlayback> VideoStreamWebm::instance_playback() { |