clang-format: Various fixes to comments alignment from clang-format
13
All reviewed manually and occasionally rewritten to avoid bad auto formatting.
This commit is contained in:
parent
42d385b312
commit
1b65550ec7
45 changed files with 417 additions and 666 deletions
|
@ -53,7 +53,7 @@
|
||||||
* @param RELATIONSHIP Relationship at which the hash table is resized. if amount of elements is RELATIONSHIP
|
* @param RELATIONSHIP Relationship at which the hash table is resized. if amount of elements is RELATIONSHIP
|
||||||
* times bigger than the hash table, table is resized to solve this condition. if RELATIONSHIP is zero, table is always MIN_HASH_TABLE_POWER.
|
* times bigger than the hash table, table is resized to solve this condition. if RELATIONSHIP is zero, table is always MIN_HASH_TABLE_POWER.
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
|
|
||||||
template <class TKey, class TData, class Hasher = HashMapHasherDefault, class Comparator = HashMapComparatorDefault<TKey>, uint8_t MIN_HASH_TABLE_POWER = 3, uint8_t RELATIONSHIP = 8>
|
template <class TKey, class TData, class Hasher = HashMapHasherDefault, class Comparator = HashMapComparatorDefault<TKey>, uint8_t MIN_HASH_TABLE_POWER = 3, uint8_t RELATIONSHIP = 8>
|
||||||
class HashMap {
|
class HashMap {
|
||||||
|
@ -454,8 +454,8 @@ public:
|
||||||
*
|
*
|
||||||
* print( *k );
|
* print( *k );
|
||||||
* }
|
* }
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
const TKey *next(const TKey *p_key) const {
|
const TKey *next(const TKey *p_key) const {
|
||||||
if (unlikely(!hash_table)) {
|
if (unlikely(!hash_table)) {
|
||||||
return nullptr;
|
return nullptr;
|
||||||
|
|
|
@ -42,7 +42,7 @@
|
||||||
* Image storage class. This is used to store an image in user memory, as well as
|
* Image storage class. This is used to store an image in user memory, as well as
|
||||||
* providing some basic methods for image manipulation.
|
* providing some basic methods for image manipulation.
|
||||||
* Images can be loaded from a file, or registered into the Render object as textures.
|
* Images can be loaded from a file, or registered into the Render object as textures.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
class Image;
|
class Image;
|
||||||
|
|
||||||
|
|
|
@ -39,8 +39,8 @@ class InputMap : public Object {
|
||||||
|
|
||||||
public:
|
public:
|
||||||
/**
|
/**
|
||||||
* A special value used to signify that a given Action can be triggered by any device
|
* A special value used to signify that a given Action can be triggered by any device
|
||||||
*/
|
*/
|
||||||
static int ALL_DEVICES;
|
static int ALL_DEVICES;
|
||||||
|
|
||||||
struct Action {
|
struct Action {
|
||||||
|
|
|
@ -36,9 +36,9 @@
|
||||||
#include "core/variant.h"
|
#include "core/variant.h"
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Miscellaneous helpers for marshalling data types, and encoding
|
* Miscellaneous helpers for marshalling data types, and encoding
|
||||||
* in an endian independent way
|
* in an endian independent way
|
||||||
*/
|
*/
|
||||||
|
|
||||||
union MarshallFloat {
|
union MarshallFloat {
|
||||||
uint32_t i; ///< int
|
uint32_t i; ///< int
|
||||||
|
|
16
core/list.h
16
core/list.h
|
@ -176,29 +176,29 @@ private:
|
||||||
|
|
||||||
public:
|
public:
|
||||||
/**
|
/**
|
||||||
* return a const iterator to the beginning of the list.
|
* return a const iterator to the beginning of the list.
|
||||||
*/
|
*/
|
||||||
_FORCE_INLINE_ const Element *front() const {
|
_FORCE_INLINE_ const Element *front() const {
|
||||||
return _data ? _data->first : nullptr;
|
return _data ? _data->first : nullptr;
|
||||||
};
|
};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* return an iterator to the beginning of the list.
|
* return an iterator to the beginning of the list.
|
||||||
*/
|
*/
|
||||||
_FORCE_INLINE_ Element *front() {
|
_FORCE_INLINE_ Element *front() {
|
||||||
return _data ? _data->first : nullptr;
|
return _data ? _data->first : nullptr;
|
||||||
};
|
};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* return a const iterator to the last member of the list.
|
* return a const iterator to the last member of the list.
|
||||||
*/
|
*/
|
||||||
_FORCE_INLINE_ const Element *back() const {
|
_FORCE_INLINE_ const Element *back() const {
|
||||||
return _data ? _data->last : nullptr;
|
return _data ? _data->last : nullptr;
|
||||||
};
|
};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* return an iterator to the last member of the list.
|
* return an iterator to the last member of the list.
|
||||||
*/
|
*/
|
||||||
_FORCE_INLINE_ Element *back() {
|
_FORCE_INLINE_ Element *back() {
|
||||||
return _data ? _data->last : nullptr;
|
return _data ? _data->last : nullptr;
|
||||||
};
|
};
|
||||||
|
|
|
@ -42,24 +42,24 @@ BVHABB_CLASS _logic_abb_merge(const BVHABB_CLASS &a, const BVHABB_CLASS &b) {
|
||||||
|
|
||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
/**
|
/**
|
||||||
@file q3DynamicAABBTree.h
|
* @file q3DynamicAABBTree.h
|
||||||
@author Randy Gaul
|
* @author Randy Gaul
|
||||||
@date 10/10/2014
|
* @date 10/10/2014
|
||||||
Copyright (c) 2014 Randy Gaul http://www.randygaul.net
|
* Copyright (c) 2014 Randy Gaul http://www.randygaul.net
|
||||||
This software is provided 'as-is', without any express or implied
|
* This software is provided 'as-is', without any express or implied
|
||||||
warranty. In no event will the authors be held liable for any damages
|
* warranty. In no event will the authors be held liable for any damages
|
||||||
arising from the use of this software.
|
* arising from the use of this software.
|
||||||
Permission is granted to anyone to use this software for any purpose,
|
* Permission is granted to anyone to use this software for any purpose,
|
||||||
including commercial applications, and to alter it and redistribute it
|
* including commercial applications, and to alter it and redistribute it
|
||||||
freely, subject to the following restrictions:
|
* freely, subject to the following restrictions:
|
||||||
1. The origin of this software must not be misrepresented; you must not
|
* 1. The origin of this software must not be misrepresented; you must not
|
||||||
claim that you wrote the original software. If you use this software
|
* claim that you wrote the original software. If you use this software
|
||||||
in a product, an acknowledgment in the product documentation would be
|
* in a product, an acknowledgment in the product documentation would be
|
||||||
appreciated but is not required.
|
* appreciated but is not required.
|
||||||
2. Altered source versions must be plainly marked as such, and must not
|
* 2. Altered source versions must be plainly marked as such, and must not
|
||||||
be misrepresented as being the original software.
|
* be misrepresented as being the original software.
|
||||||
3. This notice may not be removed or altered from any source distribution.
|
* 3. This notice may not be removed or altered from any source distribution.
|
||||||
*/
|
*/
|
||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
|
|
||||||
// This function is based on the 'Balance' function from Randy Gaul's qu3e
|
// This function is based on the 'Balance' function from Randy Gaul's qu3e
|
||||||
|
@ -67,7 +67,7 @@ BVHABB_CLASS _logic_abb_merge(const BVHABB_CLASS &a, const BVHABB_CLASS &b) {
|
||||||
// It is MODIFIED from qu3e version.
|
// It is MODIFIED from qu3e version.
|
||||||
// This is the only function used (and _logic_abb_merge helper function).
|
// This is the only function used (and _logic_abb_merge helper function).
|
||||||
int32_t _logic_balance(int32_t iA, uint32_t p_tree_id) {
|
int32_t _logic_balance(int32_t iA, uint32_t p_tree_id) {
|
||||||
// return iA; // uncomment this to bypass balance
|
//return iA; // uncomment this to bypass balance
|
||||||
|
|
||||||
TNode *A = &_nodes[iA];
|
TNode *A = &_nodes[iA];
|
||||||
|
|
||||||
|
@ -75,12 +75,12 @@ int32_t _logic_balance(int32_t iA, uint32_t p_tree_id) {
|
||||||
return iA;
|
return iA;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* A
|
/* A
|
||||||
/ \
|
* / \
|
||||||
B C
|
* B C
|
||||||
/ \ / \
|
* / \ / \
|
||||||
D E F G
|
* D E F G
|
||||||
*/
|
*/
|
||||||
|
|
||||||
CRASH_COND(A->num_children != 2);
|
CRASH_COND(A->num_children != 2);
|
||||||
int32_t iB = A->children[0];
|
int32_t iB = A->children[0];
|
||||||
|
|
|
@ -736,8 +736,6 @@ int32_t ConvexHullInternal::Rational64::compare(const Rational64 &b) const {
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
// return (numerator * b.denominator > b.numerator * denominator) ? sign : (numerator * b.denominator < b.numerator * denominator) ? -sign : 0;
|
|
||||||
|
|
||||||
#ifdef USE_X86_64_ASM
|
#ifdef USE_X86_64_ASM
|
||||||
|
|
||||||
int32_t result;
|
int32_t result;
|
||||||
|
@ -758,10 +756,9 @@ int32_t ConvexHullInternal::Rational64::compare(const Rational64 &b) const {
|
||||||
: "=&b"(result), [tmp] "=&r"(tmp), "=a"(dummy)
|
: "=&b"(result), [tmp] "=&r"(tmp), "=a"(dummy)
|
||||||
: "a"(denominator), [bn] "g"(b.numerator), [tn] "g"(numerator), [bd] "g"(b.denominator)
|
: "a"(denominator), [bn] "g"(b.numerator), [tn] "g"(numerator), [bd] "g"(b.denominator)
|
||||||
: "%rdx", "cc");
|
: "%rdx", "cc");
|
||||||
return result ? result ^ sign // if sign is +1, only bit 0 of result is inverted, which does not change the sign of result (and cannot result in zero)
|
// if sign is +1, only bit 0 of result is inverted, which does not change the sign of result (and cannot result in zero)
|
||||||
// if sign is -1, all bits of result are inverted, which changes the sign of result (and again cannot result in zero)
|
// if sign is -1, all bits of result are inverted, which changes the sign of result (and again cannot result in zero)
|
||||||
:
|
return result ? result ^ sign : 0;
|
||||||
0;
|
|
||||||
|
|
||||||
#else
|
#else
|
||||||
|
|
||||||
|
|
|
@ -48,13 +48,13 @@ public:
|
||||||
Vector3 vertex[3];
|
Vector3 vertex[3];
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
* @param p_plane plane used to split the face
|
* @param p_plane plane used to split the face
|
||||||
* @param p_res array of at least 3 faces, amount used in functio return
|
* @param p_res array of at least 3 faces, amount used in functio return
|
||||||
* @param p_is_point_over array of at least 3 booleans, determining which face is over the plane, amount used in functio return
|
* @param p_is_point_over array of at least 3 booleans, determining which face is over the plane, amount used in functio return
|
||||||
* @param _epsilon constant used for numerical error rounding, to add "thickness" to the plane (so coplanar points can happen)
|
* @param _epsilon constant used for numerical error rounding, to add "thickness" to the plane (so coplanar points can happen)
|
||||||
* @return amount of faces generated by the split, either 0 (means no split possible), 2 or 3
|
* @return amount of faces generated by the split, either 0 (means no split possible), 2 or 3
|
||||||
*/
|
*/
|
||||||
|
|
||||||
int split_by_plane(const Plane &p_plane, Face3 *p_res, bool *p_is_point_over) const;
|
int split_by_plane(const Plane &p_plane, Face3 *p_res, bool *p_is_point_over) const;
|
||||||
|
|
||||||
|
|
|
@ -102,10 +102,10 @@ enum Corner {
|
||||||
};
|
};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The "Real" type is an abstract type used for real numbers, such as 1.5,
|
* The "Real" type is an abstract type used for real numbers, such as 1.5,
|
||||||
* in contrast to integer numbers. Precision can be controlled with the
|
* in contrast to integer numbers. Precision can be controlled with the
|
||||||
* presence or absence of the REAL_T_IS_DOUBLE define.
|
* presence or absence of the REAL_T_IS_DOUBLE define.
|
||||||
*/
|
*/
|
||||||
#ifdef REAL_T_IS_DOUBLE
|
#ifdef REAL_T_IS_DOUBLE
|
||||||
typedef double real_t;
|
typedef double real_t;
|
||||||
#else
|
#else
|
||||||
|
|
|
@ -43,17 +43,14 @@ real_t Triangulate::get_area(const Vector<Vector2> &contour) {
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
is_inside_triangle decides if a point P is Inside of the triangle
|
* `is_inside_triangle` decides if a point P is inside the triangle
|
||||||
defined by A, B, C.
|
* defined by A, B, C.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
bool Triangulate::is_inside_triangle(real_t Ax, real_t Ay,
|
bool Triangulate::is_inside_triangle(real_t Ax, real_t Ay,
|
||||||
real_t Bx, real_t By,
|
real_t Bx, real_t By,
|
||||||
real_t Cx, real_t Cy,
|
real_t Cx, real_t Cy,
|
||||||
real_t Px, real_t Py,
|
real_t Px, real_t Py,
|
||||||
bool include_edges)
|
bool include_edges) {
|
||||||
|
|
||||||
{
|
|
||||||
real_t ax, ay, bx, by, cx, cy, apx, apy, bpx, bpy, cpx, cpy;
|
real_t ax, ay, bx, by, cx, cy, apx, apy, bpx, bpy, cpx, cpy;
|
||||||
real_t cCROSSap, bCROSScp, aCROSSbp;
|
real_t cCROSSap, bCROSScp, aCROSSbp;
|
||||||
|
|
||||||
|
@ -79,7 +76,7 @@ bool Triangulate::is_inside_triangle(real_t Ax, real_t Ay,
|
||||||
} else {
|
} else {
|
||||||
return ((aCROSSbp >= 0.0) && (bCROSScp >= 0.0) && (cCROSSap >= 0.0));
|
return ((aCROSSbp >= 0.0) && (bCROSScp >= 0.0) && (cCROSSap >= 0.0));
|
||||||
}
|
}
|
||||||
};
|
}
|
||||||
|
|
||||||
bool Triangulate::snip(const Vector<Vector2> &p_contour, int u, int v, int w, int n, const Vector<int> &V, bool relaxed) {
|
bool Triangulate::snip(const Vector<Vector2> &p_contour, int u, int v, int w, int n, const Vector<int> &V, bool relaxed) {
|
||||||
int p;
|
int p;
|
||||||
|
|
131
core/ustring.cpp
131
core/ustring.cpp
|
@ -310,14 +310,6 @@ String String::operator+(const String &p_str) const {
|
||||||
return res;
|
return res;
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
|
||||||
String String::operator+(CharType p_chr) const {
|
|
||||||
|
|
||||||
String res=*this;
|
|
||||||
res+=p_chr;
|
|
||||||
return res;
|
|
||||||
}
|
|
||||||
*/
|
|
||||||
String &String::operator+=(const String &p_str) {
|
String &String::operator+=(const String &p_str) {
|
||||||
if (empty()) {
|
if (empty()) {
|
||||||
*this = p_str;
|
*this = p_str;
|
||||||
|
@ -1675,14 +1667,6 @@ CharString String::utf8() const {
|
||||||
return utf8s;
|
return utf8s;
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
|
||||||
String::String(CharType p_char) {
|
|
||||||
|
|
||||||
shared=NULL;
|
|
||||||
copy_from(p_char);
|
|
||||||
}
|
|
||||||
*/
|
|
||||||
|
|
||||||
String::String(const char *p_str) {
|
String::String(const char *p_str) {
|
||||||
copy_from(p_str);
|
copy_from(p_str);
|
||||||
}
|
}
|
||||||
|
@ -1937,28 +1921,33 @@ bool String::is_numeric() const {
|
||||||
};
|
};
|
||||||
|
|
||||||
template <class C>
|
template <class C>
|
||||||
static double built_in_strtod(const C *string, /* A decimal ASCII floating-point number,
|
static double built_in_strtod(
|
||||||
* optionally preceded by white space. Must
|
/* A decimal ASCII floating-point number,
|
||||||
* have form "-I.FE-X", where I is the integer
|
* optionally preceded by white space. Must
|
||||||
* part of the mantissa, F is the fractional
|
* have form "-I.FE-X", where I is the integer
|
||||||
* part of the mantissa, and X is the
|
* part of the mantissa, F is the fractional
|
||||||
* exponent. Either of the signs may be "+",
|
* part of the mantissa, and X is the
|
||||||
* "-", or omitted. Either I or F may be
|
* exponent. Either of the signs may be "+",
|
||||||
* omitted, or both. The decimal point isn't
|
* "-", or omitted. Either I or F may be
|
||||||
* necessary unless F is present. The "E" may
|
* omitted, or both. The decimal point isn't
|
||||||
* actually be an "e". E and X may both be
|
* necessary unless F is present. The "E" may
|
||||||
* omitted (but not just one). */
|
* actually be an "e". E and X may both be
|
||||||
C **endPtr = nullptr) /* If non-NULL, store terminating Cacter's
|
* omitted (but not just one). */
|
||||||
* address here. */
|
const C *string,
|
||||||
{
|
/* If non-nullptr, store terminating Cacter's
|
||||||
static const int maxExponent = 511; /* Largest possible base 10 exponent. Any
|
* address here. */
|
||||||
* exponent larger than this will already
|
C **endPtr = nullptr) {
|
||||||
* produce underflow or overflow, so there's
|
/* Largest possible base 10 exponent. Any
|
||||||
* no need to worry about additional digits.
|
* exponent larger than this will already
|
||||||
*/
|
* produce underflow or overflow, so there's
|
||||||
static const double powersOf10[] = { /* Table giving binary powers of 10. Entry */
|
* no need to worry about additional digits. */
|
||||||
10., /* is 10^2^i. Used to convert decimal */
|
static const int maxExponent = 511;
|
||||||
100., /* exponents into floating-point numbers. */
|
/* Table giving binary powers of 10. Entry
|
||||||
|
* is 10^2^i. Used to convert decimal
|
||||||
|
* exponents into floating-point numbers. */
|
||||||
|
static const double powersOf10[] = {
|
||||||
|
10.,
|
||||||
|
100.,
|
||||||
1.0e4,
|
1.0e4,
|
||||||
1.0e8,
|
1.0e8,
|
||||||
1.0e16,
|
1.0e16,
|
||||||
|
@ -1973,25 +1962,28 @@ static double built_in_strtod(const C *string, /* A decimal ASCII floating-point
|
||||||
const double *d;
|
const double *d;
|
||||||
const C *p;
|
const C *p;
|
||||||
int c;
|
int c;
|
||||||
int exp = 0; /* Exponent read from "EX" field. */
|
/* Exponent read from "EX" field. */
|
||||||
int fracExp = 0; /* Exponent that derives from the fractional
|
int exp = 0;
|
||||||
* part. Under normal circumstances, it is
|
/* Exponent that derives from the fractional
|
||||||
* the negative of the number of digits in F.
|
* part. Under normal circumstances, it is
|
||||||
* However, if I is very long, the last digits
|
* the negative of the number of digits in F.
|
||||||
* of I get dropped (otherwise a long I with a
|
* However, if I is very long, the last digits
|
||||||
* large negative exponent could cause an
|
* of I get dropped (otherwise a long I with a
|
||||||
* unnecessary overflow on I alone). In this
|
* large negative exponent could cause an
|
||||||
* case, fracExp is incremented one for each
|
* unnecessary overflow on I alone). In this
|
||||||
* dropped digit. */
|
* case, fracExp is incremented one for each
|
||||||
int mantSize; /* Number of digits in mantissa. */
|
* dropped digit. */
|
||||||
int decPt; /* Number of mantissa digits BEFORE decimal
|
int fracExp = 0;
|
||||||
* point. */
|
/* Number of digits in mantissa. */
|
||||||
const C *pExp; /* Temporarily holds location of exponent in
|
int mantSize;
|
||||||
* string. */
|
/* Number of mantissa digits BEFORE decimal point. */
|
||||||
|
int decPt;
|
||||||
|
/* Temporarily holds location of exponent in string. */
|
||||||
|
const C *pExp;
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Strip off leading blanks and check for a sign.
|
* Strip off leading blanks and check for a sign.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
p = string;
|
p = string;
|
||||||
while (*p == ' ' || *p == '\t' || *p == '\n') {
|
while (*p == ' ' || *p == '\t' || *p == '\n') {
|
||||||
|
@ -2008,9 +2000,9 @@ static double built_in_strtod(const C *string, /* A decimal ASCII floating-point
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Count the number of digits in the mantissa (including the decimal
|
* Count the number of digits in the mantissa (including the decimal
|
||||||
* point), and also locate the decimal point.
|
* point), and also locate the decimal point.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
decPt = -1;
|
decPt = -1;
|
||||||
for (mantSize = 0;; mantSize += 1) {
|
for (mantSize = 0;; mantSize += 1) {
|
||||||
|
@ -2025,11 +2017,11 @@ static double built_in_strtod(const C *string, /* A decimal ASCII floating-point
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Now suck up the digits in the mantissa. Use two integers to collect 9
|
* Now suck up the digits in the mantissa. Use two integers to collect 9
|
||||||
* digits each (this is faster than using floating-point). If the mantissa
|
* digits each (this is faster than using floating-point). If the mantissa
|
||||||
* has more than 18 digits, ignore the extras, since they can't affect the
|
* has more than 18 digits, ignore the extras, since they can't affect the
|
||||||
* value anyway.
|
* value anyway.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
pExp = p;
|
pExp = p;
|
||||||
p -= mantSize;
|
p -= mantSize;
|
||||||
|
@ -2075,8 +2067,8 @@ static double built_in_strtod(const C *string, /* A decimal ASCII floating-point
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Skim off the exponent.
|
* Skim off the exponent.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
p = pExp;
|
p = pExp;
|
||||||
if ((*p == 'E') || (*p == 'e')) {
|
if ((*p == 'E') || (*p == 'e')) {
|
||||||
|
@ -2106,10 +2098,10 @@ static double built_in_strtod(const C *string, /* A decimal ASCII floating-point
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Generate a floating-point number that represents the exponent. Do this
|
* Generate a floating-point number that represents the exponent. Do this
|
||||||
* by processing the exponent one bit at a time to combine many powers of
|
* by processing the exponent one bit at a time to combine many powers of
|
||||||
* 2 of 10. Then combine the exponent with the fraction.
|
* 2 of 10. Then combine the exponent with the fraction.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
if (exp < 0) {
|
if (exp < 0) {
|
||||||
expSign = true;
|
expSign = true;
|
||||||
|
@ -2154,7 +2146,6 @@ done:
|
||||||
double String::to_double(const char *p_str) {
|
double String::to_double(const char *p_str) {
|
||||||
#ifndef NO_USE_STDLIB
|
#ifndef NO_USE_STDLIB
|
||||||
return built_in_strtod<char>(p_str);
|
return built_in_strtod<char>(p_str);
|
||||||
//return atof(p_str); DOES NOT WORK ON ANDROID(??)
|
|
||||||
#else
|
#else
|
||||||
return built_in_strtod<char>(p_str);
|
return built_in_strtod<char>(p_str);
|
||||||
#endif
|
#endif
|
||||||
|
|
|
@ -35,7 +35,7 @@
|
||||||
* @class Vector
|
* @class Vector
|
||||||
* @author Juan Linietsky
|
* @author Juan Linietsky
|
||||||
* Vector container. Regular Vector Container. Use with care and for smaller arrays when possible. Use PoolVector for large arrays.
|
* Vector container. Regular Vector Container. Use with care and for smaller arrays when possible. Use PoolVector for large arrays.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include "core/cowdata.h"
|
#include "core/cowdata.h"
|
||||||
#include "core/error_macros.h"
|
#include "core/error_macros.h"
|
||||||
|
|
|
@ -35,7 +35,7 @@
|
||||||
* Fast single-threaded growable array for POD types.
|
* Fast single-threaded growable array for POD types.
|
||||||
* For use in render drivers, not for general use.
|
* For use in render drivers, not for general use.
|
||||||
* TO BE REPLACED by local_vector.
|
* TO BE REPLACED by local_vector.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include "core/os/memory.h"
|
#include "core/os/memory.h"
|
||||||
#include "core/vector.h"
|
#include "core/vector.h"
|
||||||
|
|
|
@ -249,13 +249,13 @@ Error ResourceImporterWAV::import(const String &p_source_file, const String &p_s
|
||||||
//loop point info!
|
//loop point info!
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Consider exploring next document:
|
* Consider exploring next document:
|
||||||
* http://www-mmsp.ece.mcgill.ca/Documents/AudioFormats/WAVE/Docs/RIFFNEW.pdf
|
* http://www-mmsp.ece.mcgill.ca/Documents/AudioFormats/WAVE/Docs/RIFFNEW.pdf
|
||||||
* Especially on page:
|
* Especially on page:
|
||||||
* 16 - 17
|
* 16 - 17
|
||||||
* Timestamp:
|
* Timestamp:
|
||||||
* 22:38 06.07.2017 GMT
|
* 22:38 06.07.2017 GMT
|
||||||
**/
|
**/
|
||||||
|
|
||||||
for (int i = 0; i < 10; i++) {
|
for (int i = 0; i < 10; i++) {
|
||||||
file->get_32(); // i wish to know why should i do this... no doc!
|
file->get_32(); // i wish to know why should i do this... no doc!
|
||||||
|
|
|
@ -5196,10 +5196,6 @@ void CanvasItemEditor::_popup_callback(int p_op) {
|
||||||
if (key_pos) {
|
if (key_pos) {
|
||||||
ctrl->set_position(Point2());
|
ctrl->set_position(Point2());
|
||||||
}
|
}
|
||||||
/*
|
|
||||||
if (key_scale)
|
|
||||||
AnimationPlayerEditor::singleton->get_track_editor()->insert_node_value_key(ctrl,"rect/size",ctrl->get_size());
|
|
||||||
*/
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -606,15 +606,6 @@ PathEditorPlugin::PathEditorPlugin(EditorNode *p_node) {
|
||||||
menu->connect("id_pressed", this, "_handle_option_pressed");
|
menu->connect("id_pressed", this, "_handle_option_pressed");
|
||||||
|
|
||||||
curve_edit->set_pressed(true);
|
curve_edit->set_pressed(true);
|
||||||
/*
|
|
||||||
collision_polygon_editor = memnew( PathEditor(p_node) );
|
|
||||||
editor->get_viewport()->add_child(collision_polygon_editor);
|
|
||||||
collision_polygon_editor->set_margin(MARGIN_LEFT,200);
|
|
||||||
collision_polygon_editor->set_margin(MARGIN_RIGHT,230);
|
|
||||||
collision_polygon_editor->set_margin(MARGIN_TOP,0);
|
|
||||||
collision_polygon_editor->set_margin(MARGIN_BOTTOM,10);
|
|
||||||
collision_polygon_editor->hide();
|
|
||||||
*/
|
|
||||||
}
|
}
|
||||||
|
|
||||||
PathEditorPlugin::~PathEditorPlugin() {
|
PathEditorPlugin::~PathEditorPlugin() {
|
||||||
|
|
|
@ -82,46 +82,6 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||||
#include <stdint.h>
|
#include <stdint.h>
|
||||||
|
|
||||||
namespace FBXDocParser {
|
namespace FBXDocParser {
|
||||||
//enum Flag
|
|
||||||
//{
|
|
||||||
// e_unknown_0 = 1 << 0,
|
|
||||||
// e_unknown_1 = 1 << 1,
|
|
||||||
// e_unknown_2 = 1 << 2,
|
|
||||||
// e_unknown_3 = 1 << 3,
|
|
||||||
// e_unknown_4 = 1 << 4,
|
|
||||||
// e_unknown_5 = 1 << 5,
|
|
||||||
// e_unknown_6 = 1 << 6,
|
|
||||||
// e_unknown_7 = 1 << 7,
|
|
||||||
// e_unknown_8 = 1 << 8,
|
|
||||||
// e_unknown_9 = 1 << 9,
|
|
||||||
// e_unknown_10 = 1 << 10,
|
|
||||||
// e_unknown_11 = 1 << 11,
|
|
||||||
// e_unknown_12 = 1 << 12,
|
|
||||||
// e_unknown_13 = 1 << 13,
|
|
||||||
// e_unknown_14 = 1 << 14,
|
|
||||||
// e_unknown_15 = 1 << 15,
|
|
||||||
// e_unknown_16 = 1 << 16,
|
|
||||||
// e_unknown_17 = 1 << 17,
|
|
||||||
// e_unknown_18 = 1 << 18,
|
|
||||||
// e_unknown_19 = 1 << 19,
|
|
||||||
// e_unknown_20 = 1 << 20,
|
|
||||||
// e_unknown_21 = 1 << 21,
|
|
||||||
// e_unknown_22 = 1 << 22,
|
|
||||||
// e_unknown_23 = 1 << 23,
|
|
||||||
// e_flag_field_size_64_bit = 1 << 24, // Not sure what is
|
|
||||||
// e_unknown_25 = 1 << 25,
|
|
||||||
// e_unknown_26 = 1 << 26,
|
|
||||||
// e_unknown_27 = 1 << 27,
|
|
||||||
// e_unknown_28 = 1 << 28,
|
|
||||||
// e_unknown_29 = 1 << 29,
|
|
||||||
// e_unknown_30 = 1 << 30,
|
|
||||||
// e_unknown_31 = 1 << 31
|
|
||||||
//};
|
|
||||||
//
|
|
||||||
//bool check_flag(uint32_t flags, Flag to_check)
|
|
||||||
//{
|
|
||||||
// return (flags & to_check) != 0;
|
|
||||||
//}
|
|
||||||
// ------------------------------------------------------------------------------------------------
|
// ------------------------------------------------------------------------------------------------
|
||||||
Token::Token(const char *sbegin, const char *send, TokenType type, size_t offset) :
|
Token::Token(const char *sbegin, const char *send, TokenType type, size_t offset) :
|
||||||
sbegin(sbegin),
|
sbegin(sbegin),
|
||||||
|
@ -438,12 +398,6 @@ void TokenizeBinary(TokenList &output_tokens, const char *input, size_t length)
|
||||||
//TokenizeError("file is too short",0);
|
//TokenizeError("file is too short",0);
|
||||||
}
|
}
|
||||||
|
|
||||||
//uint32_t offset = 0x15;
|
|
||||||
/* const char* cursor = input + 0x15;
|
|
||||||
const uint32_t flags = ReadWord(input, cursor, input + length);
|
|
||||||
const uint8_t padding_0 = ReadByte(input, cursor, input + length); // unused
|
|
||||||
const uint8_t padding_1 = ReadByte(input, cursor, input + length); // unused*/
|
|
||||||
|
|
||||||
if (strncmp(input, "Kaydara FBX Binary", 18)) {
|
if (strncmp(input, "Kaydara FBX Binary", 18)) {
|
||||||
TokenizeError("magic bytes not found", 0);
|
TokenizeError("magic bytes not found", 0);
|
||||||
}
|
}
|
||||||
|
|
|
@ -70,8 +70,8 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
/** @file FBXCommon.h
|
/** @file FBXCommon.h
|
||||||
* Some useful constants and enums for dealing with FBX files.
|
* Some useful constants and enums for dealing with FBX files.
|
||||||
*/
|
*/
|
||||||
#ifndef FBX_COMMON_H
|
#ifndef FBX_COMMON_H
|
||||||
#define FBX_COMMON_H
|
#define FBX_COMMON_H
|
||||||
|
|
||||||
|
|
|
@ -740,13 +740,13 @@ public:
|
||||||
virtual ~AnimationCurve();
|
virtual ~AnimationCurve();
|
||||||
|
|
||||||
/** get list of keyframe positions (time).
|
/** get list of keyframe positions (time).
|
||||||
* Invariant: |GetKeys()| > 0 */
|
* Invariant: |GetKeys()| > 0 */
|
||||||
const KeyTimeList &GetKeys() const {
|
const KeyTimeList &GetKeys() const {
|
||||||
return keys;
|
return keys;
|
||||||
}
|
}
|
||||||
|
|
||||||
/** get list of keyframe values.
|
/** get list of keyframe values.
|
||||||
* Invariant: |GetKeys()| == |GetValues()| && |GetKeys()| > 0*/
|
* Invariant: |GetKeys()| == |GetValues()| && |GetKeys()| > 0*/
|
||||||
const KeyValueList &GetValues() const {
|
const KeyValueList &GetValues() const {
|
||||||
return values;
|
return values;
|
||||||
}
|
}
|
||||||
|
@ -784,8 +784,8 @@ typedef std::weak_ptr<AnimationCurveNode> AnimationCurveNodeWeakPtr;
|
||||||
class AnimationCurveNode : public Object {
|
class AnimationCurveNode : public Object {
|
||||||
public:
|
public:
|
||||||
/* the optional white list specifies a list of property names for which the caller
|
/* the optional white list specifies a list of property names for which the caller
|
||||||
wants animations for. If the curve node does not match one of these, std::range_error
|
wants animations for. If the curve node does not match one of these, std::range_error
|
||||||
will be thrown. */
|
will be thrown. */
|
||||||
AnimationCurveNode(uint64_t id, const ElementPtr element, const std::string &name, const Document &doc,
|
AnimationCurveNode(uint64_t id, const ElementPtr element, const std::string &name, const Document &doc,
|
||||||
const char *const *target_prop_whitelist = nullptr, size_t whitelist_size = 0);
|
const char *const *target_prop_whitelist = nullptr, size_t whitelist_size = 0);
|
||||||
|
|
||||||
|
@ -798,8 +798,8 @@ public:
|
||||||
const AnimationMap &Curves() const;
|
const AnimationMap &Curves() const;
|
||||||
|
|
||||||
/** Object the curve is assigned to, this can be NULL if the
|
/** Object the curve is assigned to, this can be NULL if the
|
||||||
* target object has no DOM representation or could not
|
* target object has no DOM representation or could not
|
||||||
* be read for other reasons.*/
|
* be read for other reasons.*/
|
||||||
Object *Target() const {
|
Object *Target() const {
|
||||||
return target;
|
return target;
|
||||||
}
|
}
|
||||||
|
@ -843,8 +843,8 @@ public:
|
||||||
}
|
}
|
||||||
|
|
||||||
/* the optional white list specifies a list of property names for which the caller
|
/* the optional white list specifies a list of property names for which the caller
|
||||||
wants animations for. Curves not matching this list will not be added to the
|
wants animations for. Curves not matching this list will not be added to the
|
||||||
animation layer. */
|
animation layer. */
|
||||||
const AnimationCurveNodeList Nodes(const char *const *target_prop_whitelist = nullptr, size_t whitelist_size = 0) const;
|
const AnimationCurveNodeList Nodes(const char *const *target_prop_whitelist = nullptr, size_t whitelist_size = 0) const;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
@ -952,15 +952,15 @@ public:
|
||||||
virtual ~Cluster();
|
virtual ~Cluster();
|
||||||
|
|
||||||
/** get the list of deformer weights associated with this cluster.
|
/** get the list of deformer weights associated with this cluster.
|
||||||
* Use #GetIndices() to get the associated vertices. Both arrays
|
* Use #GetIndices() to get the associated vertices. Both arrays
|
||||||
* have the same size (and may also be empty). */
|
* have the same size (and may also be empty). */
|
||||||
const std::vector<float> &GetWeights() const {
|
const std::vector<float> &GetWeights() const {
|
||||||
return weights;
|
return weights;
|
||||||
}
|
}
|
||||||
|
|
||||||
/** get indices into the vertex data of the geometry associated
|
/** get indices into the vertex data of the geometry associated
|
||||||
* with this cluster. Use #GetWeights() to get the associated weights.
|
* with this cluster. Use #GetWeights() to get the associated weights.
|
||||||
* Both arrays have the same size (and may also be empty). */
|
* Both arrays have the same size (and may also be empty). */
|
||||||
const std::vector<unsigned int> &GetIndices() const {
|
const std::vector<unsigned int> &GetIndices() const {
|
||||||
return indices;
|
return indices;
|
||||||
}
|
}
|
||||||
|
@ -1059,7 +1059,7 @@ public:
|
||||||
LazyObject *LazyDestinationObject() const;
|
LazyObject *LazyDestinationObject() const;
|
||||||
|
|
||||||
/** return the name of the property the connection is attached to.
|
/** return the name of the property the connection is attached to.
|
||||||
* this is an empty string for object to object (OO) connections. */
|
* this is an empty string for object to object (OO) connections. */
|
||||||
const std::string &PropertyName() const {
|
const std::string &PropertyName() const {
|
||||||
return prop;
|
return prop;
|
||||||
}
|
}
|
||||||
|
|
|
@ -86,30 +86,30 @@ struct ImportSettings {
|
||||||
}
|
}
|
||||||
|
|
||||||
/** enable strict mode:
|
/** enable strict mode:
|
||||||
* - only accept fbx 2012, 2013 files
|
* - only accept fbx 2012, 2013 files
|
||||||
* - on the slightest error, give up.
|
* - on the slightest error, give up.
|
||||||
*
|
*
|
||||||
* Basically, strict mode means that the fbx file will actually
|
* Basically, strict mode means that the fbx file will actually
|
||||||
* be validated. Strict mode is off by default. */
|
* be validated. Strict mode is off by default. */
|
||||||
bool strictMode;
|
bool strictMode;
|
||||||
|
|
||||||
/** specifies whether all geometry layers are read and scanned for
|
/** specifies whether all geometry layers are read and scanned for
|
||||||
* usable data channels. The FBX spec indicates that many readers
|
* usable data channels. The FBX spec indicates that many readers
|
||||||
* will only read the first channel and that this is in some way
|
* will only read the first channel and that this is in some way
|
||||||
* the recommended way- in reality, however, it happens a lot that
|
* the recommended way- in reality, however, it happens a lot that
|
||||||
* vertex data is spread among multiple layers. The default
|
* vertex data is spread among multiple layers. The default
|
||||||
* value for this option is true.*/
|
* value for this option is true.*/
|
||||||
bool readAllLayers;
|
bool readAllLayers;
|
||||||
|
|
||||||
/** specifies whether all materials are read, or only those that
|
/** specifies whether all materials are read, or only those that
|
||||||
* are referenced by at least one mesh. Reading all materials
|
* are referenced by at least one mesh. Reading all materials
|
||||||
* may make FBX reading a lot slower since all objects
|
* may make FBX reading a lot slower since all objects
|
||||||
* need to be processed .
|
* need to be processed .
|
||||||
* This bit is ignored unless readMaterials=true*/
|
* This bit is ignored unless readMaterials=true*/
|
||||||
bool readAllMaterials;
|
bool readAllMaterials;
|
||||||
|
|
||||||
/** import materials (true) or skip them and assign a default
|
/** import materials (true) or skip them and assign a default
|
||||||
* material. The default value is true.*/
|
* material. The default value is true.*/
|
||||||
bool readMaterials;
|
bool readMaterials;
|
||||||
|
|
||||||
/** import embedded textures? Default value is true.*/
|
/** import embedded textures? Default value is true.*/
|
||||||
|
@ -122,50 +122,50 @@ struct ImportSettings {
|
||||||
bool readLights;
|
bool readLights;
|
||||||
|
|
||||||
/** import animations (i.e. animation curves, the node
|
/** import animations (i.e. animation curves, the node
|
||||||
* skeleton is always imported). Default value is true. */
|
* skeleton is always imported). Default value is true. */
|
||||||
bool readAnimations;
|
bool readAnimations;
|
||||||
|
|
||||||
/** read bones (vertex weights and deform info).
|
/** read bones (vertex weights and deform info).
|
||||||
* Default value is true. */
|
* Default value is true. */
|
||||||
bool readWeights;
|
bool readWeights;
|
||||||
|
|
||||||
/** preserve transformation pivots and offsets. Since these can
|
/** preserve transformation pivots and offsets. Since these can
|
||||||
* not directly be represented in assimp, additional dummy
|
* not directly be represented in assimp, additional dummy
|
||||||
* nodes will be generated. Note that settings this to false
|
* nodes will be generated. Note that settings this to false
|
||||||
* can make animation import a lot slower. The default value
|
* can make animation import a lot slower. The default value
|
||||||
* is true.
|
* is true.
|
||||||
*
|
*
|
||||||
* The naming scheme for the generated nodes is:
|
* The naming scheme for the generated nodes is:
|
||||||
* <OriginalName>_$AssimpFbx$_<TransformName>
|
* <OriginalName>_$AssimpFbx$_<TransformName>
|
||||||
*
|
*
|
||||||
* where <TransformName> is one of
|
* where <TransformName> is one of
|
||||||
* RotationPivot
|
* RotationPivot
|
||||||
* RotationOffset
|
* RotationOffset
|
||||||
* PreRotation
|
* PreRotation
|
||||||
* PostRotation
|
* PostRotation
|
||||||
* ScalingPivot
|
* ScalingPivot
|
||||||
* ScalingOffset
|
* ScalingOffset
|
||||||
* Translation
|
* Translation
|
||||||
* Scaling
|
* Scaling
|
||||||
* Rotation
|
* Rotation
|
||||||
**/
|
**/
|
||||||
bool preservePivots;
|
bool preservePivots;
|
||||||
|
|
||||||
/** do not import animation curves that specify a constant
|
/** do not import animation curves that specify a constant
|
||||||
* values matching the corresponding node transformation.
|
* values matching the corresponding node transformation.
|
||||||
* The default value is true. */
|
* The default value is true. */
|
||||||
bool optimizeEmptyAnimationCurves;
|
bool optimizeEmptyAnimationCurves;
|
||||||
|
|
||||||
/** use legacy naming for embedded textures eg: (*0, *1, *2)
|
/** use legacy naming for embedded textures eg: (*0, *1, *2)
|
||||||
*/
|
*/
|
||||||
bool useLegacyEmbeddedTextureNaming;
|
bool useLegacyEmbeddedTextureNaming;
|
||||||
|
|
||||||
/** Empty bones shall be removed
|
/** Empty bones shall be removed
|
||||||
*/
|
*/
|
||||||
bool removeEmptyBones;
|
bool removeEmptyBones;
|
||||||
|
|
||||||
/** Set to true to perform a conversion from cm to meter after the import
|
/** Set to true to perform a conversion from cm to meter after the import
|
||||||
*/
|
*/
|
||||||
bool convertToMeters;
|
bool convertToMeters;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
@ -226,7 +226,7 @@ public:
|
||||||
const std::vector<Vector3> &GetVertices() const;
|
const std::vector<Vector3> &GetVertices() const;
|
||||||
|
|
||||||
/** Get a list of all vertex normals or an empty array if
|
/** Get a list of all vertex normals or an empty array if
|
||||||
* no normals are specified. */
|
* no normals are specified. */
|
||||||
const std::vector<Vector3> &GetNormals() const;
|
const std::vector<Vector3> &GetNormals() const;
|
||||||
|
|
||||||
/** Return list of vertex indices. */
|
/** Return list of vertex indices. */
|
||||||
|
@ -238,8 +238,8 @@ private:
|
||||||
std::vector<unsigned int> m_indices;
|
std::vector<unsigned int> m_indices;
|
||||||
};
|
};
|
||||||
/**
|
/**
|
||||||
* DOM class for FBX geometry of type "Line"
|
* DOM class for FBX geometry of type "Line"
|
||||||
*/
|
*/
|
||||||
class LineGeometry : public Geometry {
|
class LineGeometry : public Geometry {
|
||||||
public:
|
public:
|
||||||
/** The class constructor */
|
/** The class constructor */
|
||||||
|
|
|
@ -642,13 +642,6 @@ void ParseVectorDataArray(std::vector<Vector3> &out, const ElementPtr el) {
|
||||||
static_cast<real_t>(d[1]),
|
static_cast<real_t>(d[1]),
|
||||||
static_cast<real_t>(d[2])));
|
static_cast<real_t>(d[2])));
|
||||||
}
|
}
|
||||||
// for debugging
|
|
||||||
/*for ( size_t i = 0; i < out.size(); i++ ) {
|
|
||||||
aiVector3D vec3( out[ i ] );
|
|
||||||
std::stringstream stream;
|
|
||||||
stream << " vec3.x = " << vec3.x << " vec3.y = " << vec3.y << " vec3.z = " << vec3.z << std::endl;
|
|
||||||
DefaultLogger::get()->info( stream.str() );
|
|
||||||
}*/
|
|
||||||
} else if (type == 'f') {
|
} else if (type == 'f') {
|
||||||
const float *f = reinterpret_cast<const float *>(&buff[0]);
|
const float *f = reinterpret_cast<const float *>(&buff[0]);
|
||||||
for (unsigned int i = 0; i < count3; ++i, f += 3) {
|
for (unsigned int i = 0; i < count3; ++i, f += 3) {
|
||||||
|
|
|
@ -187,7 +187,7 @@ private:
|
||||||
class Parser {
|
class Parser {
|
||||||
public:
|
public:
|
||||||
/** Parse given a token list. Does not take ownership of the tokens -
|
/** Parse given a token list. Does not take ownership of the tokens -
|
||||||
* the objects must persist during the entire parser lifetime */
|
* the objects must persist during the entire parser lifetime */
|
||||||
Parser(const TokenList &tokens, bool is_binary);
|
Parser(const TokenList &tokens, bool is_binary);
|
||||||
~Parser();
|
~Parser();
|
||||||
|
|
||||||
|
|
|
@ -169,10 +169,10 @@ char EncodeBase64(char byte) {
|
||||||
}
|
}
|
||||||
|
|
||||||
/** Encodes a block of 4 bytes to base64 encoding
|
/** Encodes a block of 4 bytes to base64 encoding
|
||||||
* @param bytes Bytes to encode.
|
* @param bytes Bytes to encode.
|
||||||
* @param out_string String to write encoded values to.
|
* @param out_string String to write encoded values to.
|
||||||
* @param string_pos Position in out_string.
|
* @param string_pos Position in out_string.
|
||||||
*/
|
*/
|
||||||
void EncodeByteBlock(const char *bytes, std::string &out_string, size_t string_pos) {
|
void EncodeByteBlock(const char *bytes, std::string &out_string, size_t string_pos) {
|
||||||
char b0 = (bytes[0] & 0xFC) >> 2;
|
char b0 = (bytes[0] & 0xFC) >> 2;
|
||||||
char b1 = (bytes[0] & 0x03) << 4 | ((bytes[1] & 0xF0) >> 4);
|
char b1 = (bytes[0] & 0x03) << 4 | ((bytes[1] & 0xF0) >> 4);
|
||||||
|
|
|
@ -87,34 +87,34 @@ namespace Util {
|
||||||
const char *TokenTypeString(TokenType t);
|
const char *TokenTypeString(TokenType t);
|
||||||
|
|
||||||
/** Decode a single Base64-encoded character.
|
/** Decode a single Base64-encoded character.
|
||||||
*
|
*
|
||||||
* @param ch Character to decode (from base64 to binary).
|
* @param ch Character to decode (from base64 to binary).
|
||||||
* @return decoded byte value*/
|
* @return decoded byte value*/
|
||||||
uint8_t DecodeBase64(char ch);
|
uint8_t DecodeBase64(char ch);
|
||||||
|
|
||||||
/** Compute decoded size of a Base64-encoded string
|
/** Compute decoded size of a Base64-encoded string
|
||||||
*
|
*
|
||||||
* @param in Characters to decode.
|
* @param in Characters to decode.
|
||||||
* @param inLength Number of characters to decode.
|
* @param inLength Number of characters to decode.
|
||||||
* @return size of the decoded data (number of bytes)*/
|
* @return size of the decoded data (number of bytes)*/
|
||||||
size_t ComputeDecodedSizeBase64(const char *in, size_t inLength);
|
size_t ComputeDecodedSizeBase64(const char *in, size_t inLength);
|
||||||
|
|
||||||
/** Decode a Base64-encoded string
|
/** Decode a Base64-encoded string
|
||||||
*
|
*
|
||||||
* @param in Characters to decode.
|
* @param in Characters to decode.
|
||||||
* @param inLength Number of characters to decode.
|
* @param inLength Number of characters to decode.
|
||||||
* @param out Pointer where we will store the decoded data.
|
* @param out Pointer where we will store the decoded data.
|
||||||
* @param maxOutLength Size of output buffer.
|
* @param maxOutLength Size of output buffer.
|
||||||
* @return size of the decoded data (number of bytes)*/
|
* @return size of the decoded data (number of bytes)*/
|
||||||
size_t DecodeBase64(const char *in, size_t inLength, uint8_t *out, size_t maxOutLength);
|
size_t DecodeBase64(const char *in, size_t inLength, uint8_t *out, size_t maxOutLength);
|
||||||
|
|
||||||
char EncodeBase64(char byte);
|
char EncodeBase64(char byte);
|
||||||
|
|
||||||
/** Encode bytes in base64-encoding
|
/** Encode bytes in base64-encoding
|
||||||
*
|
*
|
||||||
* @param data Binary data to encode.
|
* @param data Binary data to encode.
|
||||||
* @param inLength Number of bytes to encode.
|
* @param inLength Number of bytes to encode.
|
||||||
* @return base64-encoded string*/
|
* @return base64-encoded string*/
|
||||||
std::string EncodeBase64(const char *data, size_t length);
|
std::string EncodeBase64(const char *data, size_t length);
|
||||||
|
|
||||||
} // namespace Util
|
} // namespace Util
|
||||||
|
|
|
@ -43,7 +43,7 @@
|
||||||
/**
|
/**
|
||||||
* Import Utils
|
* Import Utils
|
||||||
* Conversion tools / glue code to convert from FBX to Godot
|
* Conversion tools / glue code to convert from FBX to Godot
|
||||||
*/
|
*/
|
||||||
class ImportUtils {
|
class ImportUtils {
|
||||||
public:
|
public:
|
||||||
/// Convert a vector from degrees to radians.
|
/// Convert a vector from degrees to radians.
|
||||||
|
@ -201,7 +201,7 @@ public:
|
||||||
};
|
};
|
||||||
|
|
||||||
/** Get fbx fps for time mode meta data
|
/** Get fbx fps for time mode meta data
|
||||||
*/
|
*/
|
||||||
static float get_fbx_fps(int32_t time_mode) {
|
static float get_fbx_fps(int32_t time_mode) {
|
||||||
switch (time_mode) {
|
switch (time_mode) {
|
||||||
case AssetImportFbx::TIME_MODE_DEFAULT:
|
case AssetImportFbx::TIME_MODE_DEFAULT:
|
||||||
|
@ -258,13 +258,13 @@ public:
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Find hardcoded textures from assimp which could be in many different directories
|
* Find hardcoded textures from assimp which could be in many different directories
|
||||||
*/
|
*/
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* set_texture_mapping_mode
|
* set_texture_mapping_mode
|
||||||
* Helper to check the mapping mode of the texture (repeat, clamp and mirror)
|
* Helper to check the mapping mode of the texture (repeat, clamp and mirror)
|
||||||
*/
|
*/
|
||||||
// static void set_texture_mapping_mode(aiTextureMapMode *map_mode, Ref<ImageTexture> texture) {
|
// static void set_texture_mapping_mode(aiTextureMapMode *map_mode, Ref<ImageTexture> texture) {
|
||||||
// ERR_FAIL_COND(texture.is_null());
|
// ERR_FAIL_COND(texture.is_null());
|
||||||
// ERR_FAIL_COND(map_mode == NULL);
|
// ERR_FAIL_COND(map_mode == NULL);
|
||||||
|
@ -282,9 +282,9 @@ public:
|
||||||
// }
|
// }
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Load or load from cache image :)
|
* Load or load from cache image :)
|
||||||
* We need to upgrade this in the later version :) should not be hard
|
* We need to upgrade this in the later version :) should not be hard
|
||||||
*/
|
*/
|
||||||
//static Ref<Image> load_image(ImportState &state, const aiScene *p_scene, String p_path){
|
//static Ref<Image> load_image(ImportState &state, const aiScene *p_scene, String p_path){
|
||||||
|
|
||||||
// Map<String, Ref<Image> >::Element *match = state.path_to_image_cache.find(p_path);
|
// Map<String, Ref<Image> >::Element *match = state.path_to_image_cache.find(p_path);
|
||||||
|
|
|
@ -352,13 +352,6 @@ Error PluginScript::reload(bool p_keep_state) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef TOOLS_ENABLED
|
|
||||||
/*for (Set<PlaceHolderScriptInstance*>::Element *E=placeholders.front();E;E=E->next()) {
|
|
||||||
|
|
||||||
_update_placeholder(E->get());
|
|
||||||
}*/
|
|
||||||
#endif
|
|
||||||
|
|
||||||
FREE_SCRIPT_MANIFEST(manifest);
|
FREE_SCRIPT_MANIFEST(manifest);
|
||||||
return OK;
|
return OK;
|
||||||
#undef FREE_SCRIPT_MANIFEST
|
#undef FREE_SCRIPT_MANIFEST
|
||||||
|
|
|
@ -358,21 +358,21 @@ struct Command {
|
||||||
|
|
||||||
namespace TextDocumentSyncKind {
|
namespace TextDocumentSyncKind {
|
||||||
/**
|
/**
|
||||||
* Documents should not be synced at all.
|
* Documents should not be synced at all.
|
||||||
*/
|
*/
|
||||||
static const int None = 0;
|
static const int None = 0;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Documents are synced by always sending the full content
|
* Documents are synced by always sending the full content
|
||||||
* of the document.
|
* of the document.
|
||||||
*/
|
*/
|
||||||
static const int Full = 1;
|
static const int Full = 1;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Documents are synced by sending the full content on open.
|
* Documents are synced by sending the full content on open.
|
||||||
* After that only incremental updates to the document are
|
* After that only incremental updates to the document are
|
||||||
* send.
|
* send.
|
||||||
*/
|
*/
|
||||||
static const int Incremental = 2;
|
static const int Incremental = 2;
|
||||||
}; // namespace TextDocumentSyncKind
|
}; // namespace TextDocumentSyncKind
|
||||||
|
|
||||||
|
@ -667,20 +667,20 @@ struct TextDocumentContentChangeEvent {
|
||||||
// Use namespace instead of enumeration to follow the LSP specifications
|
// Use namespace instead of enumeration to follow the LSP specifications
|
||||||
namespace DiagnosticSeverity {
|
namespace DiagnosticSeverity {
|
||||||
/**
|
/**
|
||||||
* Reports an error.
|
* Reports an error.
|
||||||
*/
|
*/
|
||||||
static const int Error = 1;
|
static const int Error = 1;
|
||||||
/**
|
/**
|
||||||
* Reports a warning.
|
* Reports a warning.
|
||||||
*/
|
*/
|
||||||
static const int Warning = 2;
|
static const int Warning = 2;
|
||||||
/**
|
/**
|
||||||
* Reports an information.
|
* Reports an information.
|
||||||
*/
|
*/
|
||||||
static const int Information = 3;
|
static const int Information = 3;
|
||||||
/**
|
/**
|
||||||
* Reports a hint.
|
* Reports a hint.
|
||||||
*/
|
*/
|
||||||
static const int Hint = 4;
|
static const int Hint = 4;
|
||||||
}; // namespace DiagnosticSeverity
|
}; // namespace DiagnosticSeverity
|
||||||
|
|
||||||
|
@ -871,18 +871,18 @@ static const int TypeParameter = 25;
|
||||||
*/
|
*/
|
||||||
namespace InsertTextFormat {
|
namespace InsertTextFormat {
|
||||||
/**
|
/**
|
||||||
* The primary text to be inserted is treated as a plain string.
|
* The primary text to be inserted is treated as a plain string.
|
||||||
*/
|
*/
|
||||||
static const int PlainText = 1;
|
static const int PlainText = 1;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The primary text to be inserted is treated as a snippet.
|
* The primary text to be inserted is treated as a snippet.
|
||||||
*
|
*
|
||||||
* A snippet can define tab stops and placeholders with `$1`, `$2`
|
* A snippet can define tab stops and placeholders with `$1`, `$2`
|
||||||
* and `${3:foo}`. `$0` defines the final tab stop, it defaults to
|
* and `${3:foo}`. `$0` defines the final tab stop, it defaults to
|
||||||
* the end of the snippet. Placeholders with equal identifiers are linked,
|
* the end of the snippet. Placeholders with equal identifiers are linked,
|
||||||
* that is typing in one will update others too.
|
* that is typing in one will update others too.
|
||||||
*/
|
*/
|
||||||
static const int Snippet = 2;
|
static const int Snippet = 2;
|
||||||
}; // namespace InsertTextFormat
|
}; // namespace InsertTextFormat
|
||||||
|
|
||||||
|
@ -1359,16 +1359,16 @@ struct NativeSymbolInspectParams {
|
||||||
*/
|
*/
|
||||||
namespace FoldingRangeKind {
|
namespace FoldingRangeKind {
|
||||||
/**
|
/**
|
||||||
* Folding range for a comment
|
* Folding range for a comment
|
||||||
*/
|
*/
|
||||||
static const String Comment = "comment";
|
static const String Comment = "comment";
|
||||||
/**
|
/**
|
||||||
* Folding range for a imports or includes
|
* Folding range for a imports or includes
|
||||||
*/
|
*/
|
||||||
static const String Imports = "imports";
|
static const String Imports = "imports";
|
||||||
/**
|
/**
|
||||||
* Folding range for a region (e.g. `#region`)
|
* Folding range for a region (e.g. `#region`)
|
||||||
*/
|
*/
|
||||||
static const String Region = "region";
|
static const String Region = "region";
|
||||||
} // namespace FoldingRangeKind
|
} // namespace FoldingRangeKind
|
||||||
|
|
||||||
|
@ -1419,20 +1419,20 @@ struct FoldingRange {
|
||||||
*/
|
*/
|
||||||
namespace CompletionTriggerKind {
|
namespace CompletionTriggerKind {
|
||||||
/**
|
/**
|
||||||
* Completion was triggered by typing an identifier (24x7 code
|
* Completion was triggered by typing an identifier (24x7 code
|
||||||
* complete), manual invocation (e.g Ctrl+Space) or via API.
|
* complete), manual invocation (e.g Ctrl+Space) or via API.
|
||||||
*/
|
*/
|
||||||
static const int Invoked = 1;
|
static const int Invoked = 1;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Completion was triggered by a trigger character specified by
|
* Completion was triggered by a trigger character specified by
|
||||||
* the `triggerCharacters` properties of the `CompletionRegistrationOptions`.
|
* the `triggerCharacters` properties of the `CompletionRegistrationOptions`.
|
||||||
*/
|
*/
|
||||||
static const int TriggerCharacter = 2;
|
static const int TriggerCharacter = 2;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Completion was re-triggered as the current completion list is incomplete.
|
* Completion was re-triggered as the current completion list is incomplete.
|
||||||
*/
|
*/
|
||||||
static const int TriggerForIncompleteCompletions = 3;
|
static const int TriggerForIncompleteCompletions = 3;
|
||||||
} // namespace CompletionTriggerKind
|
} // namespace CompletionTriggerKind
|
||||||
|
|
||||||
|
@ -1441,8 +1441,8 @@ static const int TriggerForIncompleteCompletions = 3;
|
||||||
*/
|
*/
|
||||||
struct CompletionContext {
|
struct CompletionContext {
|
||||||
/**
|
/**
|
||||||
* How the completion was triggered.
|
* How the completion was triggered.
|
||||||
*/
|
*/
|
||||||
int triggerKind = CompletionTriggerKind::TriggerCharacter;
|
int triggerKind = CompletionTriggerKind::TriggerCharacter;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -1906,7 +1906,7 @@ struct GodotNativeClassInfo {
|
||||||
struct GodotCapabilities {
|
struct GodotCapabilities {
|
||||||
/**
|
/**
|
||||||
* Native class list
|
* Native class list
|
||||||
*/
|
*/
|
||||||
List<GodotNativeClassInfo> native_classes;
|
List<GodotNativeClassInfo> native_classes;
|
||||||
|
|
||||||
Dictionary to_json() {
|
Dictionary to_json() {
|
||||||
|
|
|
@ -2435,7 +2435,6 @@ void VisualScriptLanguage::debug_get_stack_level_locals(int p_level, List<String
|
||||||
const StringName *f = _call_stack[l].function;
|
const StringName *f = _call_stack[l].function;
|
||||||
|
|
||||||
ERR_FAIL_COND(!_call_stack[l].instance->functions.has(*f));
|
ERR_FAIL_COND(!_call_stack[l].instance->functions.has(*f));
|
||||||
//VisualScriptInstance::Function *func = &_call_stack[l].instance->functions[*f];
|
|
||||||
|
|
||||||
VisualScriptNodeInstance *node = _call_stack[l].instance->instances[*_call_stack[l].current_id];
|
VisualScriptNodeInstance *node = _call_stack[l].instance->instances[*_call_stack[l].current_id];
|
||||||
ERR_FAIL_COND(!node);
|
ERR_FAIL_COND(!node);
|
||||||
|
@ -2481,23 +2480,8 @@ void VisualScriptLanguage::debug_get_stack_level_locals(int p_level, List<String
|
||||||
p_locals->push_back("working_mem/mem_" + itos(i));
|
p_locals->push_back("working_mem/mem_" + itos(i));
|
||||||
p_values->push_back((*_call_stack[l].work_mem)[i]);
|
p_values->push_back((*_call_stack[l].work_mem)[i]);
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
|
||||||
ERR_FAIL_INDEX(p_level,_debug_call_stack_pos);
|
|
||||||
|
|
||||||
|
|
||||||
VisualFunction *f = _call_stack[l].function;
|
|
||||||
|
|
||||||
List<Pair<StringName,int> > locals;
|
|
||||||
|
|
||||||
f->debug_get_stack_member_state(*_call_stack[l].line,&locals);
|
|
||||||
for( List<Pair<StringName,int> >::Element *E = locals.front();E;E=E->next() ) {
|
|
||||||
|
|
||||||
p_locals->push_back(E->get().first);
|
|
||||||
p_values->push_back(_call_stack[l].stack[E->get().second]);
|
|
||||||
}
|
|
||||||
*/
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void VisualScriptLanguage::debug_get_stack_level_members(int p_level, List<String> *p_members, List<Variant> *p_values, int p_max_subitems, int p_max_depth) {
|
void VisualScriptLanguage::debug_get_stack_level_members(int p_level, List<String> *p_members, List<Variant> *p_values, int p_max_subitems, int p_max_depth) {
|
||||||
if (_debug_parse_err_node >= 0) {
|
if (_debug_parse_err_node >= 0) {
|
||||||
return;
|
return;
|
||||||
|
|
|
@ -133,28 +133,28 @@ static _WinTranslatePair _ak_to_keycode[] = {
|
||||||
};
|
};
|
||||||
/*
|
/*
|
||||||
TODO: map these android key:
|
TODO: map these android key:
|
||||||
AKEYCODE_SOFT_LEFT = 1,
|
AKEYCODE_SOFT_LEFT = 1,
|
||||||
AKEYCODE_SOFT_RIGHT = 2,
|
AKEYCODE_SOFT_RIGHT = 2,
|
||||||
AKEYCODE_CALL = 5,
|
AKEYCODE_CALL = 5,
|
||||||
AKEYCODE_ENDCALL = 6,
|
AKEYCODE_ENDCALL = 6,
|
||||||
AKEYCODE_STAR = 17,
|
AKEYCODE_STAR = 17,
|
||||||
AKEYCODE_POUND = 18,
|
AKEYCODE_POUND = 18,
|
||||||
AKEYCODE_POWER = 26,
|
AKEYCODE_POWER = 26,
|
||||||
AKEYCODE_CAMERA = 27,
|
AKEYCODE_CAMERA = 27,
|
||||||
AKEYCODE_CLEAR = 28,
|
AKEYCODE_CLEAR = 28,
|
||||||
AKEYCODE_SYM = 63,
|
AKEYCODE_SYM = 63,
|
||||||
AKEYCODE_ENVELOPE = 65,
|
AKEYCODE_ENVELOPE = 65,
|
||||||
AKEYCODE_GRAVE = 68,
|
AKEYCODE_GRAVE = 68,
|
||||||
AKEYCODE_SEMICOLON = 74,
|
AKEYCODE_SEMICOLON = 74,
|
||||||
AKEYCODE_APOSTROPHE = 75,
|
AKEYCODE_APOSTROPHE = 75,
|
||||||
AKEYCODE_AT = 77,
|
AKEYCODE_AT = 77,
|
||||||
AKEYCODE_NUM = 78,
|
AKEYCODE_NUM = 78,
|
||||||
AKEYCODE_HEADSETHOOK = 79,
|
AKEYCODE_HEADSETHOOK = 79,
|
||||||
AKEYCODE_FOCUS = 80, // *Camera* focus
|
AKEYCODE_FOCUS = 80, // *Camera* focus
|
||||||
AKEYCODE_NOTIFICATION = 83,
|
AKEYCODE_NOTIFICATION = 83,
|
||||||
AKEYCODE_SEARCH = 84,
|
AKEYCODE_SEARCH = 84,
|
||||||
AKEYCODE_PICTSYMBOLS = 94,
|
AKEYCODE_PICTSYMBOLS = 94,
|
||||||
AKEYCODE_SWITCH_CHARSET = 95,
|
AKEYCODE_SWITCH_CHARSET = 95,
|
||||||
*/
|
*/
|
||||||
|
|
||||||
unsigned int android_get_keysym(unsigned int p_code);
|
unsigned int android_get_keysym(unsigned int p_code);
|
||||||
|
|
|
@ -502,11 +502,11 @@ bool EditorExportPlatformAndroid::is_package_name_valid(const String &p_package,
|
||||||
|
|
||||||
bool EditorExportPlatformAndroid::_should_compress_asset(const String &p_path, const Vector<uint8_t> &p_data) {
|
bool EditorExportPlatformAndroid::_should_compress_asset(const String &p_path, const Vector<uint8_t> &p_data) {
|
||||||
/*
|
/*
|
||||||
* By not compressing files with little or not benefit in doing so,
|
* By not compressing files with little or not benefit in doing so,
|
||||||
* a performance gain is expected attime. Moreover, if the APK is
|
* a performance gain is expected attime. Moreover, if the APK is
|
||||||
* zip-aligned, assets stored as they are can be efficiently read by
|
* zip-aligned, assets stored as they are can be efficiently read by
|
||||||
* Android by memory-mapping them.
|
* Android by memory-mapping them.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
// -- Unconditional uncompress to mimic AAPT plus some other
|
// -- Unconditional uncompress to mimic AAPT plus some other
|
||||||
|
|
||||||
|
@ -857,16 +857,11 @@ void EditorExportPlatformAndroid::_fix_manifest(const Ref<EditorExportPreset> &p
|
||||||
int iofs = ofs + 8;
|
int iofs = ofs + 8;
|
||||||
|
|
||||||
string_count = decode_uint32(&p_manifest[iofs]);
|
string_count = decode_uint32(&p_manifest[iofs]);
|
||||||
//styles_count = decode_uint32(&p_manifest[iofs + 4]);
|
// iofs + 4 is `styles_count`.
|
||||||
string_flags = decode_uint32(&p_manifest[iofs + 8]);
|
string_flags = decode_uint32(&p_manifest[iofs + 8]);
|
||||||
string_data_offset = decode_uint32(&p_manifest[iofs + 12]);
|
string_data_offset = decode_uint32(&p_manifest[iofs + 12]);
|
||||||
//styles_offset = decode_uint32(&p_manifest[iofs + 16]);
|
// iofs + 16 is `styles_offset`.
|
||||||
/*
|
|
||||||
printf("string count: %i\n",string_count);
|
|
||||||
printf("flags: %i\n",string_flags);
|
|
||||||
printf("sdata ofs: %i\n",string_data_offset);
|
|
||||||
printf("styles ofs: %i\n",styles_offset);
|
|
||||||
*/
|
|
||||||
uint32_t st_offset = iofs + 20;
|
uint32_t st_offset = iofs + 20;
|
||||||
string_table.resize(string_count);
|
string_table.resize(string_count);
|
||||||
uint32_t string_end = 0;
|
uint32_t string_end = 0;
|
||||||
|
@ -1441,7 +1436,6 @@ void EditorExportPlatformAndroid::_fix_resources(const Ref<EditorExportPreset> &
|
||||||
encode_uint32(ret.size(), &ret.write[4]);
|
encode_uint32(ret.size(), &ret.write[4]);
|
||||||
|
|
||||||
r_manifest = ret;
|
r_manifest = ret;
|
||||||
//printf("end\n");
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void EditorExportPlatformAndroid::_load_image_data(const Ref<Image> &p_splash_image, Vector<uint8_t> &p_data) {
|
void EditorExportPlatformAndroid::_load_image_data(const Ref<Image> &p_splash_image, Vector<uint8_t> &p_data) {
|
||||||
|
|
|
@ -50,9 +50,9 @@ public class GodotDownloaderService extends DownloaderService {
|
||||||
};
|
};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* This public key comes from your Android Market publisher account, and it
|
* This public key comes from your Android Market publisher account, and it
|
||||||
* used by the LVL to validate responses from Market on your behalf.
|
* used by the LVL to validate responses from Market on your behalf.
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
public String getPublicKey() {
|
public String getPublicKey() {
|
||||||
SharedPreferences prefs = getApplicationContext().getSharedPreferences("app_data_keys", Context.MODE_PRIVATE);
|
SharedPreferences prefs = getApplicationContext().getSharedPreferences("app_data_keys", Context.MODE_PRIVATE);
|
||||||
|
@ -63,20 +63,20 @@ public class GodotDownloaderService extends DownloaderService {
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* This is used by the preference obfuscater to make sure that your
|
* This is used by the preference obfuscater to make sure that your
|
||||||
* obfuscated preferences are different than the ones used by other
|
* obfuscated preferences are different than the ones used by other
|
||||||
* applications.
|
* applications.
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
public byte[] getSALT() {
|
public byte[] getSALT() {
|
||||||
return SALT;
|
return SALT;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Fill this in with the class name for your alarm receiver. We do this
|
* Fill this in with the class name for your alarm receiver. We do this
|
||||||
* because receivers must be unique across all of Android (it's a good idea
|
* because receivers must be unique across all of Android (it's a good idea
|
||||||
* to make sure that your receiver is in your unique package)
|
* to make sure that your receiver is in your unique package)
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
public String getAlarmReceiverClassName() {
|
public String getAlarmReceiverClassName() {
|
||||||
Log.d("GODOT", "getAlarmReceiverClassName()");
|
Log.d("GODOT", "getAlarmReceiverClassName()");
|
||||||
|
|
|
@ -33,25 +33,25 @@ Adapted from corresponding SDL 2.0 code.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
/*
|
/*
|
||||||
Simple DirectMedia Layer
|
* Simple DirectMedia Layer
|
||||||
Copyright (C) 1997-2017 Sam Lantinga <slouken@libsdl.org>
|
* Copyright (C) 1997-2017 Sam Lantinga <slouken@libsdl.org>
|
||||||
|
*
|
||||||
This software is provided 'as-is', without any express or implied
|
* This software is provided 'as-is', without any express or implied
|
||||||
warranty. In no event will the authors be held liable for any damages
|
* warranty. In no event will the authors be held liable for any damages
|
||||||
arising from the use of this software.
|
* arising from the use of this software.
|
||||||
|
*
|
||||||
Permission is granted to anyone to use this software for any purpose,
|
* Permission is granted to anyone to use this software for any purpose,
|
||||||
including commercial applications, and to alter it and redistribute it
|
* including commercial applications, and to alter it and redistribute it
|
||||||
freely, subject to the following restrictions:
|
* freely, subject to the following restrictions:
|
||||||
|
*
|
||||||
1. The origin of this software must not be misrepresented; you must not
|
* 1. The origin of this software must not be misrepresented; you must not
|
||||||
claim that you wrote the original software. If you use this software
|
* claim that you wrote the original software. If you use this software
|
||||||
in a product, an acknowledgment in the product documentation would be
|
* in a product, an acknowledgment in the product documentation would be
|
||||||
appreciated but is not required.
|
* appreciated but is not required.
|
||||||
2. Altered source versions must be plainly marked as such, and must not be
|
* 2. Altered source versions must be plainly marked as such, and must not be
|
||||||
misrepresented as being the original software.
|
* misrepresented as being the original software.
|
||||||
3. This notice may not be removed or altered from any source distribution.
|
* 3. This notice may not be removed or altered from any source distribution.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include "power_android.h"
|
#include "power_android.h"
|
||||||
|
|
||||||
|
|
|
@ -33,25 +33,25 @@ Adapted from corresponding SDL 2.0 code.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
/*
|
/*
|
||||||
Simple DirectMedia Layer
|
* Simple DirectMedia Layer
|
||||||
Copyright (C) 1997-2017 Sam Lantinga <slouken@libsdl.org>
|
* Copyright (C) 1997-2017 Sam Lantinga <slouken@libsdl.org>
|
||||||
|
*
|
||||||
This software is provided 'as-is', without any express or implied
|
* This software is provided 'as-is', without any express or implied
|
||||||
warranty. In no event will the authors be held liable for any damages
|
* warranty. In no event will the authors be held liable for any damages
|
||||||
arising from the use of this software.
|
* arising from the use of this software.
|
||||||
|
*
|
||||||
Permission is granted to anyone to use this software for any purpose,
|
* Permission is granted to anyone to use this software for any purpose,
|
||||||
including commercial applications, and to alter it and redistribute it
|
* including commercial applications, and to alter it and redistribute it
|
||||||
freely, subject to the following restrictions:
|
* freely, subject to the following restrictions:
|
||||||
|
*
|
||||||
1. The origin of this software must not be misrepresented; you must not
|
* 1. The origin of this software must not be misrepresented; you must not
|
||||||
claim that you wrote the original software. If you use this software
|
* claim that you wrote the original software. If you use this software
|
||||||
in a product, an acknowledgment in the product documentation would be
|
* in a product, an acknowledgment in the product documentation would be
|
||||||
appreciated but is not required.
|
* appreciated but is not required.
|
||||||
2. Altered source versions must be plainly marked as such, and must not be
|
* 2. Altered source versions must be plainly marked as such, and must not be
|
||||||
misrepresented as being the original software.
|
* misrepresented as being the original software.
|
||||||
3. This notice may not be removed or altered from any source distribution.
|
* 3. This notice may not be removed or altered from any source distribution.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include "power_osx.h"
|
#include "power_osx.h"
|
||||||
|
|
||||||
|
|
|
@ -919,15 +919,15 @@ class EditorExportPlatformUWP : public EditorExportPlatform {
|
||||||
|
|
||||||
static bool _should_compress_asset(const String &p_path, const Vector<uint8_t> &p_data) {
|
static bool _should_compress_asset(const String &p_path, const Vector<uint8_t> &p_data) {
|
||||||
/* TODO: This was copied verbatim from Android export. It should be
|
/* TODO: This was copied verbatim from Android export. It should be
|
||||||
* refactored to the parent class and also be used for .zip export.
|
* refactored to the parent class and also be used for .zip export.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* By not compressing files with little or not benefit in doing so,
|
* By not compressing files with little or not benefit in doing so,
|
||||||
* a performance gain is expected at runtime. Moreover, if the APK is
|
* a performance gain is expected at runtime. Moreover, if the APK is
|
||||||
* zip-aligned, assets stored as they are can be efficiently read by
|
* zip-aligned, assets stored as they are can be efficiently read by
|
||||||
* Android by memory-mapping them.
|
* Android by memory-mapping them.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
// -- Unconditional uncompress to mimic AAPT plus some other
|
// -- Unconditional uncompress to mimic AAPT plus some other
|
||||||
|
|
||||||
|
|
|
@ -42,10 +42,10 @@ PowerUWP::~PowerUWP() {
|
||||||
bool PowerUWP::UpdatePowerInfo() {
|
bool PowerUWP::UpdatePowerInfo() {
|
||||||
// TODO, WinRT: Battery info is available on at least one WinRT platform (Windows Phone 8). Implement UpdatePowerInfo as appropriate. */
|
// TODO, WinRT: Battery info is available on at least one WinRT platform (Windows Phone 8). Implement UpdatePowerInfo as appropriate. */
|
||||||
/* Notes from SDL:
|
/* Notes from SDL:
|
||||||
- the Win32 function, GetSystemPowerStatus, is not available for use on WinRT
|
* - the Win32 function, GetSystemPowerStatus, is not available for use on WinRT
|
||||||
- Windows Phone 8 has a 'Battery' class, which is documented as available for C++
|
* - Windows Phone 8 has a 'Battery' class, which is documented as available for C++
|
||||||
- More info on WP8's Battery class can be found at http://msdn.microsoft.com/library/windowsphone/develop/jj207231
|
* - More info on WP8's Battery class can be found at http://msdn.microsoft.com/library/windowsphone/develop/jj207231
|
||||||
*/
|
*/
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -33,25 +33,25 @@ Adapted from corresponding SDL 2.0 code.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
/*
|
/*
|
||||||
Simple DirectMedia Layer
|
* Simple DirectMedia Layer
|
||||||
Copyright (C) 1997-2017 Sam Lantinga <slouken@libsdl.org>
|
* Copyright (C) 1997-2017 Sam Lantinga <slouken@libsdl.org>
|
||||||
|
*
|
||||||
This software is provided 'as-is', without any express or implied
|
* This software is provided 'as-is', without any express or implied
|
||||||
warranty. In no event will the authors be held liable for any damages
|
* warranty. In no event will the authors be held liable for any damages
|
||||||
arising from the use of this software.
|
* arising from the use of this software.
|
||||||
|
*
|
||||||
Permission is granted to anyone to use this software for any purpose,
|
* Permission is granted to anyone to use this software for any purpose,
|
||||||
including commercial applications, and to alter it and redistribute it
|
* including commercial applications, and to alter it and redistribute it
|
||||||
freely, subject to the following restrictions:
|
* freely, subject to the following restrictions:
|
||||||
|
*
|
||||||
1. The origin of this software must not be misrepresented; you must not
|
* 1. The origin of this software must not be misrepresented; you must not
|
||||||
claim that you wrote the original software. If you use this software
|
* claim that you wrote the original software. If you use this software
|
||||||
in a product, an acknowledgment in the product documentation would be
|
* in a product, an acknowledgment in the product documentation would be
|
||||||
appreciated but is not required.
|
* appreciated but is not required.
|
||||||
2. Altered source versions must be plainly marked as such, and must not be
|
* 2. Altered source versions must be plainly marked as such, and must not be
|
||||||
misrepresented as being the original software.
|
* misrepresented as being the original software.
|
||||||
3. This notice may not be removed or altered from any source distribution.
|
* 3. This notice may not be removed or altered from any source distribution.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include "power_windows.h"
|
#include "power_windows.h"
|
||||||
|
|
||||||
|
|
|
@ -468,15 +468,6 @@ Error OS_X11::initialize(const VideoMode &p_desired, int p_video_driver, int p_a
|
||||||
XISelectEvents(x11_display, x11_window, &xi.all_event_mask, 1);
|
XISelectEvents(x11_display, x11_window, &xi.all_event_mask, 1);
|
||||||
XISelectEvents(x11_display, DefaultRootWindow(x11_display), &xi.all_master_event_mask, 1);
|
XISelectEvents(x11_display, DefaultRootWindow(x11_display), &xi.all_master_event_mask, 1);
|
||||||
|
|
||||||
// Disabled by now since grabbing also blocks mouse events
|
|
||||||
// (they are received as extended events instead of standard events)
|
|
||||||
/*XIClearMask(xi.touch_event_mask.mask, XI_TouchOwnership);
|
|
||||||
|
|
||||||
// Grab touch devices to avoid OS gesture interference
|
|
||||||
for (int i = 0; i < xi.touch_devices.size(); ++i) {
|
|
||||||
XIGrabDevice(x11_display, xi.touch_devices[i], x11_window, CurrentTime, None, XIGrabModeAsync, XIGrabModeAsync, False, &xi.touch_event_mask);
|
|
||||||
}*/
|
|
||||||
|
|
||||||
/* set the titlebar name */
|
/* set the titlebar name */
|
||||||
XStoreName(x11_display, x11_window, "Godot");
|
XStoreName(x11_display, x11_window, "Godot");
|
||||||
|
|
||||||
|
@ -2469,10 +2460,7 @@ void OS_X11::process_xevents() {
|
||||||
xi.last_relative_time = raw_event->time;
|
xi.last_relative_time = raw_event->time;
|
||||||
} break;
|
} break;
|
||||||
#ifdef TOUCH_ENABLED
|
#ifdef TOUCH_ENABLED
|
||||||
case XI_TouchBegin: // Fall-through
|
case XI_TouchBegin:
|
||||||
// Disabled hand-in-hand with the grabbing
|
|
||||||
//XIAllowTouchEvents(x11_display, event_data->deviceid, event_data->detail, x11_window, XIAcceptTouch);
|
|
||||||
|
|
||||||
case XI_TouchEnd: {
|
case XI_TouchEnd: {
|
||||||
bool is_begin = event_data->evtype == XI_TouchBegin;
|
bool is_begin = event_data->evtype == XI_TouchBegin;
|
||||||
|
|
||||||
|
|
|
@ -33,25 +33,25 @@ Adapted from corresponding SDL 2.0 code.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
/*
|
/*
|
||||||
Simple DirectMedia Layer
|
* Simple DirectMedia Layer
|
||||||
Copyright (C) 1997-2017 Sam Lantinga <slouken@libsdl.org>
|
* Copyright (C) 1997-2017 Sam Lantinga <slouken@libsdl.org>
|
||||||
|
*
|
||||||
This software is provided 'as-is', without any express or implied
|
* This software is provided 'as-is', without any express or implied
|
||||||
warranty. In no event will the authors be held liable for any damages
|
* warranty. In no event will the authors be held liable for any damages
|
||||||
arising from the use of this software.
|
* arising from the use of this software.
|
||||||
|
*
|
||||||
Permission is granted to anyone to use this software for any purpose,
|
* Permission is granted to anyone to use this software for any purpose,
|
||||||
including commercial applications, and to alter it and redistribute it
|
* including commercial applications, and to alter it and redistribute it
|
||||||
freely, subject to the following restrictions:
|
* freely, subject to the following restrictions:
|
||||||
|
*
|
||||||
1. The origin of this software must not be misrepresented; you must not
|
* 1. The origin of this software must not be misrepresented; you must not
|
||||||
claim that you wrote the original software. If you use this software
|
* claim that you wrote the original software. If you use this software
|
||||||
in a product, an acknowledgment in the product documentation would be
|
* in a product, an acknowledgment in the product documentation would be
|
||||||
appreciated but is not required.
|
* appreciated but is not required.
|
||||||
2. Altered source versions must be plainly marked as such, and must not be
|
* 2. Altered source versions must be plainly marked as such, and must not be
|
||||||
misrepresented as being the original software.
|
* misrepresented as being the original software.
|
||||||
3. This notice may not be removed or altered from any source distribution.
|
* 3. This notice may not be removed or altered from any source distribution.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include "power_x11.h"
|
#include "power_x11.h"
|
||||||
|
|
||||||
|
|
|
@ -46,7 +46,7 @@
|
||||||
definition of invalidation: global is invalid
|
definition of invalidation: global is invalid
|
||||||
|
|
||||||
1) If a node sets a LOCAL, it produces an invalidation of everything above
|
1) If a node sets a LOCAL, it produces an invalidation of everything above
|
||||||
a) If above is invalid, don't keep invalidating upwards
|
. a) If above is invalid, don't keep invalidating upwards
|
||||||
2) If a node sets a GLOBAL, it is converted to LOCAL (and forces validation of everything pending below)
|
2) If a node sets a GLOBAL, it is converted to LOCAL (and forces validation of everything pending below)
|
||||||
|
|
||||||
drawback: setting/reading globals is useful and used very very often, and using affine inverses is slow
|
drawback: setting/reading globals is useful and used very very often, and using affine inverses is slow
|
||||||
|
@ -58,7 +58,7 @@
|
||||||
definition of invalidation: NONE dirty, LOCAL dirty, GLOBAL dirty
|
definition of invalidation: NONE dirty, LOCAL dirty, GLOBAL dirty
|
||||||
|
|
||||||
1) If a node sets a LOCAL, it must climb the tree and set it as GLOBAL dirty
|
1) If a node sets a LOCAL, it must climb the tree and set it as GLOBAL dirty
|
||||||
a) marking GLOBALs as dirty up all the tree must be done always
|
. a) marking GLOBALs as dirty up all the tree must be done always
|
||||||
2) If a node sets a GLOBAL, it marks local as dirty, and that's all?
|
2) If a node sets a GLOBAL, it marks local as dirty, and that's all?
|
||||||
|
|
||||||
//is clearing the dirty state correct in this case?
|
//is clearing the dirty state correct in this case?
|
||||||
|
|
|
@ -102,11 +102,11 @@ void Control::_edit_set_position(const Point2 &p_position) {
|
||||||
// Unlikely to happen. TODO: enclose all _edit_ functions into TOOLS_ENABLED
|
// Unlikely to happen. TODO: enclose all _edit_ functions into TOOLS_ENABLED
|
||||||
set_position(p_position);
|
set_position(p_position);
|
||||||
#endif
|
#endif
|
||||||
};
|
}
|
||||||
|
|
||||||
Point2 Control::_edit_get_position() const {
|
Point2 Control::_edit_get_position() const {
|
||||||
return get_position();
|
return get_position();
|
||||||
};
|
}
|
||||||
|
|
||||||
void Control::_edit_set_scale(const Size2 &p_scale) {
|
void Control::_edit_set_scale(const Size2 &p_scale) {
|
||||||
set_scale(p_scale);
|
set_scale(p_scale);
|
||||||
|
@ -541,14 +541,6 @@ void Control::_notification(int p_notification) {
|
||||||
viewport->connect("size_changed", this, "_size_changed");
|
viewport->connect("size_changed", this, "_size_changed");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
|
||||||
if (data.theme.is_null() && data.parent && data.parent->data.theme_owner) {
|
|
||||||
data.theme_owner=data.parent->data.theme_owner;
|
|
||||||
notification(NOTIFICATION_THEME_CHANGED);
|
|
||||||
}
|
|
||||||
*/
|
|
||||||
|
|
||||||
} break;
|
} break;
|
||||||
case NOTIFICATION_EXIT_CANVAS: {
|
case NOTIFICATION_EXIT_CANVAS: {
|
||||||
if (data.parent_canvas_item) {
|
if (data.parent_canvas_item) {
|
||||||
|
@ -675,10 +667,6 @@ bool Control::has_point(const Point2 &p_point) const {
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
/*if (has_stylebox("mask")) {
|
|
||||||
Ref<StyleBox> mask = get_stylebox("mask");
|
|
||||||
return mask->test_mask(p_point,Rect2(Point2(),get_size()));
|
|
||||||
}*/
|
|
||||||
return Rect2(Point2(), get_size()).has_point(p_point);
|
return Rect2(Point2(), get_size()).has_point(p_point);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -2565,16 +2553,6 @@ void Control::warp_mouse(const Point2 &p_to_pos) {
|
||||||
}
|
}
|
||||||
|
|
||||||
bool Control::is_text_field() const {
|
bool Control::is_text_field() const {
|
||||||
/*
|
|
||||||
if (get_script_instance()) {
|
|
||||||
Variant v=p_point;
|
|
||||||
const Variant *p[2]={&v,&p_data};
|
|
||||||
Variant::CallError ce;
|
|
||||||
Variant ret = get_script_instance()->call("is_text_field",p,2,ce);
|
|
||||||
if (ce.error==Variant::CallError::CALL_OK)
|
|
||||||
return ret;
|
|
||||||
}
|
|
||||||
*/
|
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -266,7 +266,7 @@ PrimitiveMesh::~PrimitiveMesh() {
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
CapsuleMesh
|
CapsuleMesh
|
||||||
*/
|
*/
|
||||||
|
|
||||||
void CapsuleMesh::_create_mesh_array(Array &p_arr) const {
|
void CapsuleMesh::_create_mesh_array(Array &p_arr) const {
|
||||||
|
|
|
@ -33,9 +33,11 @@
|
||||||
void AudioFilterSW::set_mode(Mode p_mode) {
|
void AudioFilterSW::set_mode(Mode p_mode) {
|
||||||
mode = p_mode;
|
mode = p_mode;
|
||||||
}
|
}
|
||||||
|
|
||||||
void AudioFilterSW::set_cutoff(float p_cutoff) {
|
void AudioFilterSW::set_cutoff(float p_cutoff) {
|
||||||
cutoff = p_cutoff;
|
cutoff = p_cutoff;
|
||||||
}
|
}
|
||||||
|
|
||||||
void AudioFilterSW::set_resonance(float p_resonance) {
|
void AudioFilterSW::set_resonance(float p_resonance) {
|
||||||
resonance = p_resonance;
|
resonance = p_resonance;
|
||||||
}
|
}
|
||||||
|
@ -178,21 +180,13 @@ void AudioFilterSW::prepare_coefficients(Coeffs *p_coeffs) {
|
||||||
p_coeffs->b2 /= a0;
|
p_coeffs->b2 /= a0;
|
||||||
p_coeffs->a1 /= 0.0 - a0;
|
p_coeffs->a1 /= 0.0 - a0;
|
||||||
p_coeffs->a2 /= 0.0 - a0;
|
p_coeffs->a2 /= 0.0 - a0;
|
||||||
|
|
||||||
//undenormalise
|
|
||||||
/* p_coeffs->b0=undenormalise(p_coeffs->b0);
|
|
||||||
p_coeffs->b1=undenormalise(p_coeffs->b1);
|
|
||||||
p_coeffs->b2=undenormalise(p_coeffs->b2);
|
|
||||||
p_coeffs->a1=undenormalise(p_coeffs->a1);
|
|
||||||
p_coeffs->a2=undenormalise(p_coeffs->a2);*/
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void AudioFilterSW::set_stages(int p_stages) { //adjust for multiple stages
|
void AudioFilterSW::set_stages(int p_stages) {
|
||||||
|
|
||||||
stages = p_stages;
|
stages = p_stages;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Fouriertransform kernel to obtain response */
|
/* Fourier transform kernel to obtain response */
|
||||||
|
|
||||||
float AudioFilterSW::get_response(float p_freq, Coeffs *p_coeffs) {
|
float AudioFilterSW::get_response(float p_freq, Coeffs *p_coeffs) {
|
||||||
float freq = p_freq / sampling_rate * Math_PI * 2.0f;
|
float freq = p_freq / sampling_rate * Math_PI * 2.0f;
|
||||||
|
|
|
@ -152,11 +152,11 @@ public:
|
||||||
|
|
||||||
//! Test limit
|
//! Test limit
|
||||||
/*!
|
/*!
|
||||||
- free means upper < lower,
|
* - free means upper < lower,
|
||||||
- locked means upper == lower
|
* - locked means upper == lower
|
||||||
- limited means upper > lower
|
* - limited means upper > lower
|
||||||
- limitIndex: first 3 are linear, next 3 are angular
|
* - limitIndex: first 3 are linear, next 3 are angular
|
||||||
*/
|
*/
|
||||||
inline bool isLimited(int limitIndex) {
|
inline bool isLimited(int limitIndex) {
|
||||||
return (m_upperLimit[limitIndex] >= m_lowerLimit[limitIndex]);
|
return (m_upperLimit[limitIndex] >= m_lowerLimit[limitIndex]);
|
||||||
}
|
}
|
||||||
|
@ -239,25 +239,15 @@ public:
|
||||||
virtual bool setup(real_t p_timestep);
|
virtual bool setup(real_t p_timestep);
|
||||||
virtual void solve(real_t p_timestep);
|
virtual void solve(real_t p_timestep);
|
||||||
|
|
||||||
//! Calcs global transform of the offsets
|
// Calcs the global transform for the joint offset for body A an B, and also calcs the angle differences between the bodies.
|
||||||
/*!
|
|
||||||
Calcs the global transform for the joint offset for body A an B, and also calcs the agle differences between the bodies.
|
|
||||||
\sa Generic6DOFJointSW.getCalculatedTransformA , Generic6DOFJointSW.getCalculatedTransformB, Generic6DOFJointSW.calculateAngleInfo
|
|
||||||
*/
|
|
||||||
void calculateTransforms();
|
void calculateTransforms();
|
||||||
|
|
||||||
//! Gets the global transform of the offset for body A
|
// Gets the global transform of the offset for body A. */
|
||||||
/*!
|
|
||||||
\sa Generic6DOFJointSW.getFrameOffsetA, Generic6DOFJointSW.getFrameOffsetB, Generic6DOFJointSW.calculateAngleInfo.
|
|
||||||
*/
|
|
||||||
const Transform &getCalculatedTransformA() const {
|
const Transform &getCalculatedTransformA() const {
|
||||||
return m_calculatedTransformA;
|
return m_calculatedTransformA;
|
||||||
}
|
}
|
||||||
|
|
||||||
//! Gets the global transform of the offset for body B
|
// Gets the global transform of the offset for body B.
|
||||||
/*!
|
|
||||||
\sa Generic6DOFJointSW.getFrameOffsetA, Generic6DOFJointSW.getFrameOffsetB, Generic6DOFJointSW.calculateAngleInfo.
|
|
||||||
*/
|
|
||||||
const Transform &getCalculatedTransformB() const {
|
const Transform &getCalculatedTransformB() const {
|
||||||
return m_calculatedTransformB;
|
return m_calculatedTransformB;
|
||||||
}
|
}
|
||||||
|
@ -344,11 +334,11 @@ public:
|
||||||
|
|
||||||
//! Test limit
|
//! Test limit
|
||||||
/*!
|
/*!
|
||||||
- free means upper < lower,
|
* - free means upper < lower,
|
||||||
- locked means upper == lower
|
* - locked means upper == lower
|
||||||
- limited means upper > lower
|
* - limited means upper > lower
|
||||||
- limitIndex: first 3 are linear, next 3 are angular
|
* - limitIndex: first 3 are linear, next 3 are angular
|
||||||
*/
|
*/
|
||||||
bool isLimited(int limitIndex) {
|
bool isLimited(int limitIndex) {
|
||||||
if (limitIndex < 3) {
|
if (limitIndex < 3) {
|
||||||
return m_linearLimits.isLimited(limitIndex);
|
return m_linearLimits.isLimited(limitIndex);
|
||||||
|
|
|
@ -651,92 +651,3 @@ BroadPhase2DHashGrid::~BroadPhase2DHashGrid() {
|
||||||
|
|
||||||
memdelete_arr(hash_table);
|
memdelete_arr(hash_table);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* 3D version of voxel traversal:
|
|
||||||
|
|
||||||
public IEnumerable<Point3D> GetCellsOnRay(Ray ray, int maxDepth)
|
|
||||||
{
|
|
||||||
// Implementation is based on:
|
|
||||||
// "A Fast Voxel Traversal Algorithm for Ray Tracing"
|
|
||||||
// John Amanatides, Andrew Woo
|
|
||||||
// http://www.cse.yorku.ca/~amana/research/grid.pdf
|
|
||||||
// https://web.archive.org/web/20100616193049/http://www.devmaster.net/articles/raytracing_series/A%20faster%20voxel%20traversal%20algorithm%20for%20ray%20tracing.pdf
|
|
||||||
|
|
||||||
// NOTES:
|
|
||||||
// * This code assumes that the ray's position and direction are in 'cell coordinates', which means
|
|
||||||
// that one unit equals one cell in all directions.
|
|
||||||
// * When the ray doesn't start within the voxel grid, calculate the first position at which the
|
|
||||||
// ray could enter the grid. If it never enters the grid, there is nothing more to do here.
|
|
||||||
// * Also, it is important to test when the ray exits the voxel grid when the grid isn't infinite.
|
|
||||||
// * The Point3D structure is a simple structure having three integer fields (X, Y and Z).
|
|
||||||
|
|
||||||
// The cell in which the ray starts.
|
|
||||||
Point3D start = GetCellAt(ray.Position); // Rounds the position's X, Y and Z down to the nearest integer values.
|
|
||||||
int x = start.X;
|
|
||||||
int y = start.Y;
|
|
||||||
int z = start.Z;
|
|
||||||
|
|
||||||
// Determine which way we go.
|
|
||||||
int stepX = Math.Sign(ray.Direction.X);
|
|
||||||
int stepY = Math.Sign(ray.Direction.Y);
|
|
||||||
int stepZ = Math.Sign(ray.Direction.Z);
|
|
||||||
|
|
||||||
// Calculate cell boundaries. When the step (i.e. direction sign) is positive,
|
|
||||||
// the next boundary is AFTER our current position, meaning that we have to add 1.
|
|
||||||
// Otherwise, it is BEFORE our current position, in which case we add nothing.
|
|
||||||
Point3D cellBoundary = new Point3D(
|
|
||||||
x + (stepX > 0 ? 1 : 0),
|
|
||||||
y + (stepY > 0 ? 1 : 0),
|
|
||||||
z + (stepZ > 0 ? 1 : 0));
|
|
||||||
|
|
||||||
// NOTE: For the following calculations, the result will be Single.PositiveInfinity
|
|
||||||
// when ray.Direction.X, Y or Z equals zero, which is OK. However, when the left-hand
|
|
||||||
// value of the division also equals zero, the result is Single.NaN, which is not OK.
|
|
||||||
|
|
||||||
// Determine how far we can travel along the ray before we hit a voxel boundary.
|
|
||||||
Vector3 tMax = new Vector3(
|
|
||||||
(cellBoundary.X - ray.Position.X) / ray.Direction.X, // Boundary is a plane on the YZ axis.
|
|
||||||
(cellBoundary.Y - ray.Position.Y) / ray.Direction.Y, // Boundary is a plane on the XZ axis.
|
|
||||||
(cellBoundary.Z - ray.Position.Z) / ray.Direction.Z); // Boundary is a plane on the XY axis.
|
|
||||||
if (Single.IsNaN(tMax.X)) tMax.X = Single.PositiveInfinity;
|
|
||||||
if (Single.IsNaN(tMax.Y)) tMax.Y = Single.PositiveInfinity;
|
|
||||||
if (Single.IsNaN(tMax.Z)) tMax.Z = Single.PositiveInfinity;
|
|
||||||
|
|
||||||
// Determine how far we must travel along the ray before we have crossed a gridcell.
|
|
||||||
Vector3 tDelta = new Vector3(
|
|
||||||
stepX / ray.Direction.X, // Crossing the width of a cell.
|
|
||||||
stepY / ray.Direction.Y, // Crossing the height of a cell.
|
|
||||||
stepZ / ray.Direction.Z); // Crossing the depth of a cell.
|
|
||||||
if (Single.IsNaN(tDelta.X)) tDelta.X = Single.PositiveInfinity;
|
|
||||||
if (Single.IsNaN(tDelta.Y)) tDelta.Y = Single.PositiveInfinity;
|
|
||||||
if (Single.IsNaN(tDelta.Z)) tDelta.Z = Single.PositiveInfinity;
|
|
||||||
|
|
||||||
// For each step, determine which distance to the next voxel boundary is lowest (i.e.
|
|
||||||
// which voxel boundary is nearest) and walk that way.
|
|
||||||
for (int i = 0; i < maxDepth; i++)
|
|
||||||
{
|
|
||||||
// Return it.
|
|
||||||
yield return new Point3D(x, y, z);
|
|
||||||
|
|
||||||
// Do the next step.
|
|
||||||
if (tMax.X < tMax.Y && tMax.X < tMax.Z)
|
|
||||||
{
|
|
||||||
// tMax.X is the lowest, an YZ cell boundary plane is nearest.
|
|
||||||
x += stepX;
|
|
||||||
tMax.X += tDelta.X;
|
|
||||||
}
|
|
||||||
else if (tMax.Y < tMax.Z)
|
|
||||||
{
|
|
||||||
// tMax.Y is the lowest, an XZ cell boundary plane is nearest.
|
|
||||||
y += stepY;
|
|
||||||
tMax.Y += tDelta.Y;
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
// tMax.Z is the lowest, an XY cell boundary plane is nearest.
|
|
||||||
z += stepZ;
|
|
||||||
tMax.Z += tDelta.Z;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
*/
|
|
||||||
|
|
Loading…
Reference in a new issue