New answers tagged

0

The +1 is in there because Attack_speed is actually a cooldown stat, where half as much Attack_speed makes you attack twice as fast. If you have a "+100% increase" to your attack speed with the WoW formula, you get outputs like Attack_speed = 1.8 / ( (100 / 100) + 1 ) = 0.9. Similarly, if you have a "-99% decrease" to your attack speed with the WoW formula, ...


4

Let's look at your particular suggestion for a formula and what range of values it is able to handle: attack_speed = 1.8 - (1.8 * (x / 100)) What if x is larger than 100? Now you have a negative attack speed. What is that even supposed to mean mechanics-wise? Adding a 1 when calculating a divisor ensures that the division will always reduce the value ...


0

I was not involved in the development of WoW, but reading the first formula, I'd say that they added 1 to prevent the case (that may happen a lot with very low level / unnequipped characters) of division by zero. If the "Percent increase or decrease" value is 0, you'll end up with "current attack speed" being divided by zero. In the "+1" version the only ...


1

A few rules of thumb around this, if the calculation only needs to be done once and applies to the entire object, then you will get best bang for buck calculating it prior to loading onto the GPU. IF though the calculation does change then you also need to consider where in the GPU pipeline it should be calculated. For instance, if you can calculate the ...


0

The CPU could perform the calculations in a faster rate than a GPU due to higher clock frequency. However, the GPU can do a lot more calculations in parallel. If you are working on a large data set, where you operate on each item in the same way, the GPU can be a lot more efficient, however it requires some setup, like uploading data to the GPU, executing a ...


0

Building on Gale's answer, I made the formula/math a little simpler, and I added my working C# code. I've built this in Unity, and used the same variables as Gale did. SHMin // 1. Get the max angle that E can turn (whichever way) in Radians = maxEAng float maxEAng = Mathf.Max(Mathf.Abs(EHinge.min), Mathf.Abs(EHinge.max)) * Mathf.Deg2Rad; // 2. Use the ...


1

Note that I said "first" not "after" - you're using the transform method backwards. Vector3 ClosestPointOnMeshOBB(MeshFilter meshFilter, Vector3 worldPoint) { // First, we transform the point into the local coordinate space of the mesh. var localPoint = meshFilter.transform.InverseTransformPoint(worldPoint); // Next, we compare it against ...


0

you should use colliders and raycast. tray to make a box collider for you box mesh. then cast a ray from point to center of box. void Update() { if (Input.GetMouseButtonDown(0)) { RaycastHit hit; var ray = Camera.main.ScreenPointToRay(Input.mousePosition); if (Physics.Raycast(ray, out hit)) ...


1

There is one LINE that solves this problem if this is a 2D question (supported because the known points in the image have '0's for y-coordinates, so your line will be entirely in XZ-plane). However, as a line is a set of infinitely many points, any point that is on the solution line will be a solution point. You need a line through (-1.75, 0, -2.32), ...


1

There is not a specific answer to this question as stated. (Assuming that this is in 3d space, as the coordinates list three values.) Technically, there are infinite perpendicular lines rotated around the black line. If you have a third point, you can use the Cross Product to get a perpendicular vector, like: i = B - A; j = C - A; p = (i.y * j.z - i.z * j....


1

when a given line with certain equation is give. it has slope of m. so the line that is perpendicular to it has slope of -1/m check this link: https://www.mathsisfun.com/algebra/line-parallel-perpendicular.html you have one point and find out the wanted slope so you can build equation of new line


0

To get the local position, rotation you can decompose the local matrix of the child object. You can calculate the local matrix by multiplying the inverse global matrix of the parent with the global matrix of the child. Like this (example with glm) Matrix4 invParentMatrix = glm::inverse(GetParent()->GetGlobalMatrix()); LocalChildMatrix = invParentMatrix ...


1

BONUS ANSWER: The question is only asking for, "Can the arm reach the point?" However, the next question would typically be, "What angles do I set each joint to so that the arm is touching the point?" My first answer describes the set up nicely, so using the terms of the answer, I will answer the followup question. At this point, we know the absolute values ...


2

Given that the arm exists in a 2D plane, the joints are hinge joints and not ball and socket joints, and the rotation arc for each joint is +/- maxangle: Let H = the position of the end effector. Let S = the position of the "shoulder" joint. Let Slen = the length from the shoulder to the elbow. Let Sdef = a normal vector representing the default ...


0

This is the updated code, with code for handling some edge cases. Also, I made sure the BULLET_SPEED large enough for the Equations to work: private bool GetProjectileDirection(GObject target, GObject source, out Vector3 direction) { direction = Vector3.Zero; Vector2 w = new Vector2(target.Position.x - source.Position.x, target.Position.y - ...


Top 50 recent answers are included