I hope i understand all your questions right, im not sure yet about all technical terms you use to describe.
> Your VEC global variables
as far as i see have only this
|
VEC const GRAVITY = Prdct(-0.00001, uV(1, 2));
|
> Your VEC member declarations in other structs and classes
im not sure what you mean, correct me if im wrong.
I dont have any structs and with VEC and two other classes, MAT (if VEC is a vector, MAT is a matrix.) and RECT (a physical object that gets rendered and uses VEC's and MAT's as is physics)
they look like this:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20
|
class MAT {
public:
MAT();
MAT(int, int);
MAT(int, int, double*);
//~MAT(); for MAT's i have the same problem as in VECs. but since VEC's dont use MATS its not caused here... getting the solution for VEC's should work for MAT's too.
double get(int, int);
void set(int, int, double);
void copy(MAT);
void add(MAT);
void subtract(MAT);
void mult(double);
void mult(MAT);
void mult(MAT, bool);
void print();
int dimX, dimY;
bool quadratic;
private:
double* data;
};
|
and the RECT:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28
|
class Rect {
public:
Rect();
Rect(int, double, double, double, double, double, double, double, double);
~Rect();
void WriteRectEdges(float*);
void InitEdges();
void UpdateEdges();
void SetInactive();
double GetMass();
void DoLogic1();
void DoLogic2();
void DoLogic3();
void BounceEdge(VEC, VEC, VEC);
void Impact(VEC, VEC);
void ImpactLocal(VEC, VEC);
private:
bool active = false;
int index;
double w, h, angle, vel_angle;
double mass;
double momentum_of_inertia;
int AMOUNT_OF_EDGES;
VEC pos;
VEC vel;
VEC normalized_edges[4];
VEC edg[4];
};
|
> Did you use memcpy() (or similar functions) to copy VEC objects?
no, not at all.
all my functions that use VEC, like "Sum(VEC, VEC)" always creates a new VEC as the sum of the other 2,
and the void's declared in the class like "add(VEC)" adds another vector do this one, so it just overwrites its data. but they dont get called before the crash, i logged all of them.
> When assigning a VEC object to another VEC object, have you removed all assignment operators (=) and replaced them with VEC copy functions?
I think I never used "=" at all for VEC's.
edit: from this i excluded when i define new VECs with '='.. does this count as well? for example the GRAVITY above.
I hope thats all the information you need, if not let me know.
edit2: your copy function didnt change anything. like i said, it doesnt get called anyway, my Log function works 100%. (at least this..)
@Thomas1965 i think we already tried the '=' thingy. and yeah you need the directx 11 sdk