Reputation
1,735
Top tag
Next privilege 2,000 Rep.
Edit questions and answers
Badges
3 12
Newest
 Yearling
Impact
~40k people reached

Jan
30
comment Is this converting from or to premultiplied alpha?
Note that to avoid precision loss, and properly take advantage of the structure discovered by OP, the original operation should probably be: var r = (byte) ( (color.R*divAlpha + 0x80) >> 8);
Jan
30
revised Is this converting from or to premultiplied alpha?
added 229 characters in body
Jan
30
answered Is this converting from or to premultiplied alpha?
Jan
6
comment Use constant force to hold something in position
any two constants add to a third constant - so constraint of a single constant force is eminently sensible.
Jan
2
comment Most efficient way to convert Vector3 to Vector2
@DMGregory: That's fair; but "These types of struct operations are never going to be the performance-determining bottleneck" is patently false as they can be a performance determining bottleneck if careless boxing is occurring. Plus, if a boxing issue is happening here it is probably happening in many other, also performance-critical, code locations, causing
Jan
2
comment Most efficient way to convert Vector3 to Vector2
@DMGregory: Unless, of course, OP has already done a performance analysis and, perhaps due to boxing, actually has this in a nested loop causing a performance problem. Such a nested loop might, for example, be an A-star or Dijkstra implementation.
Jan
2
revised Most efficient way to convert Vector3 to Vector2
added 20 characters in body
Jan
2
answered Most efficient way to convert Vector3 to Vector2
Dec
28
comment Efficient movement of units to different points with different speeds
Read up on Traveling Salesman problem - that's what you are asking about.
Dec
3
comment How to extract euler angles from transformation matrix?
Note, however, the problem when y = pi/2 and thus cos(y) == 0. Then it is NOT the case that M[1][3] and M[2][3] can be used to obtain x because the ratio is undefined, and not atan2 value can be obtained. I believe that this is equivalent to the gimbal lock problem.
Nov
25
comment What does maximum normalized frictional force mean in this tutorial?
@AdriansNetlis: Correct. See my update.
Nov
25
revised What does maximum normalized frictional force mean in this tutorial?
added 579 characters in body
Nov
25
revised What does maximum normalized frictional force mean in this tutorial?
added 657 characters in body
Nov
25
answered What does maximum normalized frictional force mean in this tutorial?
Nov
20
comment Hexagonal Tilemap is being distorted
You have a rounding error occurring. Check your pixel placement values carefully for both odd and even columns of hexes. I encountered the same problem with my game, and it took a little finagling of the numbers to get everything lined up. If you draw zoomed instead of zooming the drawing you will encounter the same problem gain at certain zoom leves.
Nov
17
comment Rotate coordinates back after rotating game context (geometry)
Additional details relevant to your question might be found at my other answer here: gamedev.stackexchange.com/questions/111343/…
Nov
15
revised Get local coords from global coords
added 14 characters in body
Nov
15
revised Get local coords from global coords
added 13 characters in body
Nov
15
revised Get local coords from global coords
added 403 characters in body
Nov
15
answered Get local coords from global coords