acos(forward_dir.dot(target_dir)
angle in radian between the two vectors
acos(forward_dir.dot(target_dir)
angle in radian between the two vectors
/ state.step
basically times fps(e.g. divide by 0.016 = time 60), this is because angular velocity is a per second
unit, engine subsequently will integrate this value by times delta again.
forward_dir.cross(target_dir)
a vector that will be the rotation axis, perpendicular to both vectors, and since they are unit vectors, this is sin(a). this means it will rotate to target direction faster if their angle are larger.
(target_position - current_transform.origin)
a vector point to target_position
globally
(current_transform.basis * forward_local_axis)
transform forward_local_axis
to point to the global x direction.
all a game does is transform some data (assets, inputs, state) into some other data (graphics commands, new game states)
very profound statement.
minimize the amount of transformations
does "transformations" here mean, for example, loading some files into the game?
cheap solution
but backward solution is also not "perfect", right? using the previous example, this time hapless peasant will indeed have a chance to update, but after heroine update, foul beast gets deleted, loop decrements, heroine update twice?
can't be represented exactly by a float
This is saying why (2.55).toFixed(1)
evaluates to 2.5, cuz, internally, 2.55 is actually, 2.5499999999..., which evals to 2.5 indeed.
After your component is removed from the DOM, React will run your cleanup function
setup
.cause the chat to re-connect every time the component re-renders
because, before, it was depending on only 'roomId' and 'serverUrl', if they didn't change, it will not re-connect. but now, when 'onReceiveMessage' function is included in the dependency array, it will re-connect when re-rendered, because it's a new function every time.
or
possible typo: 'or' should be 'of'.
read
"read" here means decode it to inspect its content.
automatically calls
wow. so if the grantType
is authorization code flow type, this parseFromUrl()
function actually automatically does an entire extra step which is the POST to get the token.
same channel
here's the key difference to implicit flow. the token and other info properties are return as the response of the POST request.
which malicious browser extensions would not have access to
according to the next paragraph, at least in this example case of okta, we don't need manual access to the random secret generated by frontend code.
match
number
to the code
field.code
是一个number
类型,它也会被筛掉。@github.com/mj2068
But, we can also make immutable copies like before if we want to
Immer
, we can 'mutate' states directly. but we can also return state as well.to respond and update its own state in response to other action types besides the types it has generated
extraReducers
exists.extraReducers
存在的原因。