diff options
-rw-r--r-- | core/math/random_pcg.cpp | 14 | ||||
-rw-r--r-- | core/math/random_pcg.h | 21 | ||||
-rw-r--r-- | doc/classes/ArrayMesh.xml | 7 | ||||
-rw-r--r-- | doc/classes/Input.xml | 9 | ||||
-rw-r--r-- | doc/classes/InputEvent.xml | 8 | ||||
-rw-r--r-- | doc/classes/KinematicBody.xml | 4 | ||||
-rw-r--r-- | doc/classes/Skeleton.xml | 4 | ||||
-rw-r--r-- | doc/classes/UndoRedo.xml | 6 | ||||
-rw-r--r-- | modules/opensimplex/doc_classes/NoiseTexture.xml | 2 |
9 files changed, 52 insertions, 23 deletions
diff --git a/core/math/random_pcg.cpp b/core/math/random_pcg.cpp index 8bbcca88fe..8c324414e6 100644 --- a/core/math/random_pcg.cpp +++ b/core/math/random_pcg.cpp @@ -32,24 +32,24 @@ #include "core/os/os.h" -RandomPCG::RandomPCG(uint64_t seed, uint64_t inc) : +RandomPCG::RandomPCG(uint64_t p_seed, uint64_t p_inc) : pcg() { - pcg.state = seed; - pcg.inc = inc; + pcg.inc = p_inc; + seed(p_seed); } void RandomPCG::randomize() { seed(OS::get_singleton()->get_ticks_usec() * pcg.state + PCG_DEFAULT_INC_64); } -double RandomPCG::random(double from, double to) { +double RandomPCG::random(double p_from, double p_to) { unsigned int r = rand(); double ret = (double)r / (double)RANDOM_MAX; - return (ret) * (to - from) + from; + return (ret) * (p_to - p_from) + p_from; } -float RandomPCG::random(float from, float to) { +float RandomPCG::random(float p_from, float p_to) { unsigned int r = rand(); float ret = (float)r / (float)RANDOM_MAX; - return (ret) * (to - from) + from; + return (ret) * (p_to - p_from) + p_from; } diff --git a/core/math/random_pcg.h b/core/math/random_pcg.h index 2a69d43904..f6cc3db595 100644 --- a/core/math/random_pcg.h +++ b/core/math/random_pcg.h @@ -37,28 +37,33 @@ class RandomPCG { pcg32_random_t pcg; + uint64_t current_seed = DEFAULT_SEED; // seed with this to get the same state public: static const uint64_t DEFAULT_SEED = 12047754176567800795U; static const uint64_t DEFAULT_INC = PCG_DEFAULT_INC_64; static const uint64_t RANDOM_MAX = 0xFFFFFFFF; - RandomPCG(uint64_t seed = DEFAULT_SEED, uint64_t inc = PCG_DEFAULT_INC_64); + RandomPCG(uint64_t p_seed = DEFAULT_SEED, uint64_t p_inc = PCG_DEFAULT_INC_64); - _FORCE_INLINE_ void seed(uint64_t seed) { - pcg.state = seed; + _FORCE_INLINE_ void seed(uint64_t p_seed) { + current_seed = p_seed; + pcg.state = p_seed; pcg32_random_r(&pcg); // Force changing internal state to avoid initial 0 } - _FORCE_INLINE_ uint64_t get_seed() { return pcg.state; } + _FORCE_INLINE_ uint64_t get_seed() { return current_seed; } void randomize(); - _FORCE_INLINE_ uint32_t rand() { return pcg32_random_r(&pcg); } + _FORCE_INLINE_ uint32_t rand() { + current_seed = pcg.state; + return pcg32_random_r(&pcg); + } _FORCE_INLINE_ double randd() { return (double)rand() / (double)RANDOM_MAX; } _FORCE_INLINE_ float randf() { return (float)rand() / (float)RANDOM_MAX; } - double random(double from, double to); - float random(float from, float to); - real_t random(int from, int to) { return (real_t)random((real_t)from, (real_t)to); } + double random(double p_from, double p_to); + float random(float p_from, float p_to); + real_t random(int p_from, int p_to) { return (real_t)random((real_t)p_from, (real_t)p_to); } }; #endif // RANDOM_PCG_H diff --git a/doc/classes/ArrayMesh.xml b/doc/classes/ArrayMesh.xml index bcb9b4f6da..fd66777997 100644 --- a/doc/classes/ArrayMesh.xml +++ b/doc/classes/ArrayMesh.xml @@ -53,13 +53,6 @@ Godot uses clockwise winding order for front faces of triangle primitive modes. </description> </method> - <method name="center_geometry"> - <return type="void"> - </return> - <description> - Centers the geometry. - </description> - </method> <method name="clear_blend_shapes"> <return type="void"> </return> diff --git a/doc/classes/Input.xml b/doc/classes/Input.xml index 724e6a078d..29c60f902e 100644 --- a/doc/classes/Input.xml +++ b/doc/classes/Input.xml @@ -325,6 +325,15 @@ Set the mouse mode. See the constants for more information. </description> </method> + <method name="set_use_accumulated_input"> + <return type="void"> + </return> + <argument index="0" name="enable" type="bool"> + </argument> + <description> + Whether to accumulate similar input events sent by the operating system. Defaults to [code]true[/code]. + </description> + </method> <method name="start_joy_vibration"> <return type="void"> </return> diff --git a/doc/classes/InputEvent.xml b/doc/classes/InputEvent.xml index c880823aee..cd08cd4fe7 100644 --- a/doc/classes/InputEvent.xml +++ b/doc/classes/InputEvent.xml @@ -13,6 +13,14 @@ <demos> </demos> <methods> + <method name="accumulate"> + <return type="bool"> + </return> + <argument index="0" name="with_event" type="InputEvent"> + </argument> + <description> + </description> + </method> <method name="as_text" qualifiers="const"> <return type="String"> </return> diff --git a/doc/classes/KinematicBody.xml b/doc/classes/KinematicBody.xml index 83abd723d0..4aec75d89f 100644 --- a/doc/classes/KinematicBody.xml +++ b/doc/classes/KinematicBody.xml @@ -65,7 +65,9 @@ </argument> <argument index="1" name="infinite_inertia" type="bool" default="true"> </argument> - <argument index="2" name="test_only" type="bool" default="false"> + <argument index="2" name="exclude_raycast_shapes" type="bool" default="true"> + </argument> + <argument index="3" name="test_only" type="bool" default="false"> </argument> <description> Moves the body along the vector [code]rel_vec[/code]. The body will stop if it collides. Returns a [KinematicCollision], which contains information about the collision. diff --git a/doc/classes/Skeleton.xml b/doc/classes/Skeleton.xml index 233df28255..f07329f31f 100644 --- a/doc/classes/Skeleton.xml +++ b/doc/classes/Skeleton.xml @@ -259,6 +259,10 @@ </description> </method> </methods> + <members> + <member name="bones_in_world_transform" type="bool" setter="set_use_bones_in_world_transform" getter="is_using_bones_in_world_transform"> + </member> + </members> <constants> <constant name="NOTIFICATION_UPDATE_SKELETON" value="50"> </constant> diff --git a/doc/classes/UndoRedo.xml b/doc/classes/UndoRedo.xml index 8d98bcfdb0..f0980f6414 100644 --- a/doc/classes/UndoRedo.xml +++ b/doc/classes/UndoRedo.xml @@ -143,6 +143,12 @@ This is useful mostly to check if something changed from a saved version. </description> </method> + <method name="is_commiting_action" qualifiers="const"> + <return type="bool"> + </return> + <description> + </description> + </method> <method name="redo"> <return type="bool"> </return> diff --git a/modules/opensimplex/doc_classes/NoiseTexture.xml b/modules/opensimplex/doc_classes/NoiseTexture.xml index ba54160a90..a91114b2f7 100644 --- a/modules/opensimplex/doc_classes/NoiseTexture.xml +++ b/modules/opensimplex/doc_classes/NoiseTexture.xml @@ -17,6 +17,8 @@ <member name="as_normalmap" type="bool" setter="set_as_normalmap" getter="is_normalmap"> If true, the resulting texture contains a normal map created from the original noise interpreted as a bump map. </member> + <member name="bump_strength" type="float" setter="set_bump_strength" getter="get_bump_strength"> + </member> <member name="height" type="int" setter="set_height" getter="get_height"> Height of the generated texture. </member> |