WoW Memory EditingWoW Memory Editing for learning purposes only.
This section is more advanced than others on MMOwnedRead the section specific rules, infractions will be given out if u break them!That is including the expectations! - If you don't meet them then don't post
I'm making a list of locations that will need to be 6 yards apart each. I have a start and end point. I'm using atan to get the angle for the right triangle. I was hoping someone could point me in the right direction to finish this up.
Donate to remove ads, get your "DONATOR title, and get access to the MMOwned community's elite Shoutbawx.
No, I have no problem finding angle etc. I am having issues making the list of locations itself. I have a start and end location, but I need to find points in between at 6 unit increments.
No, I have no problem finding angle etc. I am having issues making the list of locations itself. I have a start and end location, but I need to find points in between at 6 unit increments.
You really gotta be more specific. Is it supposed to be a staight line? There's an infinite number of ways to connect 2 points.
If it's supposed to be a straight line:
Point A(xa,ya,za) and point B(xb,yb,zb).
v = (xb-xa,yb-ya,zb-za) = (xv,yv,zv)
n = sqrt(xv^2 + yv^2 + zv^2) w = 1 / n * v
OP[ i ] = OA + 6i * w = P[ i ] // P[ i ] is the i-th point that is 6*i yards away from point A into the direction of AB.
__________________
[[ fMES - Firstgrade Math Explanation Section - Robske ]]
EDIT: Anyone know how to make your window stay on top when you select WoW? It's an injected form through clr hosting, and topmost property doesnt work. Tips?
No, it's because my form is created behind WoW in z-order for some reason. It wants to stay that way. I've been looking for a way to draw a form onto a directx control or something... No avail yet.
By behind in z-order, I mean that my window is a child of WoW and it wants to be in front. lol.
void getPointsBetween(Vec3f a, Vec3f b, Vec3f *Points[])
{
Vec3f v = a - b;
float n = sqrt(v.x*v.x + v.y*v.y + v.z*v.z);
Vec3f w = (1 / n) * v; // = Vec3f( (1/n)*v.x, (1/n)*v.y, (1/n)*v.z );
#define STEPSIZE 2
int numPoints = n/STEPSIZE;
Points = new Vec3f[numPoints];
for( int i = 0; i < numPoints; i++ )
{
Points[i] = a + ((STEPSIZE*i)*w); // = Vec3f( a.x + STEPSIZE*i*v.x, a.y + STEPSIZE*i*v.y, a.z + STEPSIZE*i*v.z );
}
}
(Its 0437. Tired. Excuse errors.)
Just wanted to point out to anyone who wants to use code based off this there are some things you need to keep in mind:
The vectors are heap allocated and hence need to be manually deleted. To avoid this problem use a shared_ptr.
The way the data is returned is also potentially more dangerous than it needs to be. You're better off either making the function take a vector by reference, or take an insertion iterator. The most obvious candidate for the latter being a back_inserter. The advantage of an insertion iterator is that you can generalize the algorithm so that it's not container-dependent.
Also, if you're dealing with large data sets you might want to catch bad_alloc exceptions in-case 'operator new' throws (or if your C++ implementation uses a nothrow new implementation then do a null check), then return a boolean indicating whether the operation succeeded or not.
__________________
[Only registered and activated users can see links. ]Back online!
"Science is interesting, and if you don't agree you can **** off." [Only registered and activated users can see links. ]
"I can write very coherent things when I try that sound very good" -- Styles