gamephysics101 / 02-newtons-laws Goto Github PK
View Code? Open in Web Editor NEWNewtons laws of motion explained through Unity 3D in C# as part of https://www.udemy.com/gamephysics.
License: MIT License
Newtons laws of motion explained through Unity 3D in C# as part of https://www.udemy.com/gamephysics.
License: MIT License
As of Unity 5.5, the following public functions are deprecated for the LineRenderer;
SetColors
SetWidth
SetVertexCount
These are last documented in version 5.4 of the Unity Scripting API documentation;
https://docs.unity3d.com/540/Documentation/ScriptReference/LineRenderer.html
These public functions are used within DrawForces.cs, which is provided within the NL02 Newtons Laws Assets.unitypackage, linked from Section 2, Lecture 7 (at time of writing). Additionally, these also appear within the PhysicsEngine.cs file, after the changes are made in Section 2, Lecture 13, and subsequently appear in the repository here.
At the time of writing, Unity 2018.2.2f1 still supports them but warns that they are deprecated.
The following lines of code can be used to replace the deprecated function calls and resolve this issue for more recent versions of Unity, 5.6 onwards;
lineRenderer.startColor = Color.yellow;
lineRenderer.endColor = Color.yellow;
lineRenderer.startWidth = 0.2f;
lineRenderer.endWidth = 0.2f;
and
lineRenderer.positionCount = numberOfForces * 2;
hi, I am learn this course form udemy now . But I find something weird.
in CalculateGravity()
"physicsEngineA != this" is seemed not necessary.Instance of UniversalGravitation is never equal Instance of PhysicsEngine. on the other world "physicsEngineA != this" is always true.
And if There is only one Instance of UniversalGravitation in the game world.
Just use "physicsEngineA !=physicsEngineB" can get the correct result.
Hypothesis physicsEngineArray={a,b,c}
then
{a} is applied force from
{b,c}
{b} is applied force from
{a,c}
{c} is applied force from
{a,b}
But The object can be dynamically generated, so I think need a global container to memory all instance of PhysicsEngine. and all physicsEngine need to add his self to the container in function start.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.