Git Product home page Git Product logo

Comments (3)

souvikinator avatar souvikinator commented on June 4, 2024 1

Can refer to this:
https://gitlab.com/snopek-games/sg-physics-2d

Doesn't support rigid bodies and is written from scratch but the author has created a separate vector implementation

from godot-rapier-2d.

Ughuuu avatar Ughuuu commented on June 4, 2024

Running the following code:

extends Node2D


func _ready():
	var angle_start = -PI
	var steps = 1000
	var step_increase = 1.0 / steps
	var hash_final :int = 0
	for step in 1000:
		var angle :float= angle_start + step * step_increase * 2 * PI
		var value :float= step * step_increase * 10
		var str1 :String= "angle: " + str(angle) + " sin: " + str(sin(angle))+ " cos: "+ str(cos(angle))+ " tan: "+ str(tan(angle))
		var str2 :String= "value: " + str(value) + " sqrt: " + str(sqrt(value))
		hash_final += str1.hash()
		hash_final += str2.hash()
	print(hash_final)

on both mac and web, I get the following hashes:

  • mac: 4235844765204
  • web: 4233582584233

So it seems the sin/cos/tan/sqrt implementations are indeed not cross platform deterministic.

from godot-rapier-2d.

souvikinator avatar souvikinator commented on June 4, 2024

For me it gives same hash:

Web: 4233582584233
Linux: 4233582584233

from godot-rapier-2d.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.