This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.
Pages: « 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 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 »
167
Issues Help Desk / Re: Combining members
« on: January 15, 2011, 08:20:29 pm »
Yeah, the point of combining them was to force both classes to use the same value. Anyways, thanks for the help.
168
Proposals / Re: Shader effects
« on: January 15, 2011, 04:48:37 pm »
All of it is true.
All of it.
All of it.
169
Issues Help Desk / Combining members
« on: January 15, 2011, 04:46:52 pm »Code: [Select]
struct foo { int x; };
struct bar { int x; };
struct foobar : public foo, public bar {};
results in a class with the members foo::x and bar::x. However, foobar::x does not exist. Is there any way to do this?Example:
Code: [Select]
foobar val;
val.x = 5;
results in:Code: [Select]
error: request for member ‘x’ is ambiguous
error: candidates are: int bar::x
error: int foo::x
172
Function Peer Review / Re: move_towards_point
« on: January 11, 2011, 04:49:46 pm »
oh, well, ignore what I posted, then
173
Function Peer Review / Re: move_towards_point
« on: January 11, 2011, 04:14:14 pm »
Yeah, it is. Updated:
Suggestion: point_direction_radians
Code: [Select]
void motion_set(double newdir, double newspd) {
enigma::object_planar* const inst = ((enigma::object_planar*)enigma::instance_event_iterator->inst);
inst->direction.rval.d = newdir;
inst->speed.rval.d = newspd;
inst->hspeed.rval.d = newspd * cos(degtorad(newdir));
inst->vspeed.rval.d = newspd * sin(degtorad(newdir));
}
inline void move_towards_point(double x, double y, double spd) {
motion_set(point_direction(
((enigma::object_planar*)enigma::instance_event_iterator->inst)->x,
((enigma::object_planar*)enigma::instance_event_iterator->inst)->y,
x,y),spd);
}
void motion_add(double newdir, double newspd) {
enigma::object_planar* const inst = ((enigma::object_planar*)enigma::instance_event_iterator->inst);
inst->hspeed.rval.d += newspd * cos(degtorad(newdir));
inst->vspeed.rval.d += newspd * sin(degtorad(newdir));
inst->direction.rval.d = point_direction(0, 0, inst->hspeed.rval.d, inst->vspeed.rval.d);
inst->speed.rval.d = abs(hypot(inst->hspeed.rval.d, inst->vspeed.rval.d));
}
Suggestion: point_direction_radians
174
Function Peer Review / Re: move_towards_point
« on: January 09, 2011, 06:22:56 pm »I think also did this one (move_towards_point). Is anyone actually reading this?In GML, not C++.
175
Function Peer Review / Re: move_towards_point
« on: January 08, 2011, 05:34:03 pm »
move_towards_point should be inline, at least. :V
176
Proposals / Re: Object member functons
« on: January 08, 2011, 05:33:38 pm »
That was actually what he mentioned doing, I believe.
177
Proposals / Re: Object member functons
« on: January 08, 2011, 12:51:20 pm »
Polygone, I wasn't suggesting any solution. I was mentioning what would actually happen.
I think that, like obj.x, obj.func() should only operate on one instance.
I think that, like obj.x, obj.func() should only operate on one instance.
178
Function Peer Review / Re: move_towards_point
« on: January 07, 2011, 10:11:30 pm »
Also, random thing to mention, but:
Code: (C++) [Select]
void motion_set(double newdir, double newspd) {
enigma::object_planar* const inst = ((enigma::object_planar*)enigma::instance_event_iterator->inst);
inst->direction.rval.d = newdir;
inst->speed.rval.d = newspd;
inst->hspeed.rval.d = newspd * cos(newdir);
inst->vspeed.rval.d = newspd * sin(newdir);
}
inline void move_towards_point(double x, double y, double spd) {
motion_set(point_direction(
((enigma::object_planar*)enigma::instance_event_iterator->inst)->x,
((enigma::object_planar*)enigma::instance_event_iterator->inst)->y,
x,y),spd);
}
void motion_add(double newdir, double newspd) {
enigma::object_planar* const inst = ((enigma::object_planar*)enigma::instance_event_iterator->inst);
inst->hspeed.rval.d += newspd * cos(newdir);
inst->vspeed.rval.d += newspd * sin(newdir);
inst->direction.rval.d = point_direction(0, 0, inst->hspeed.rval.d, inst->vspeed.rval.d);
inst->speed.rval.d = abs(hypot(inst->hspeed.rval.d, inst->vspeed.rval.d));
}
179
Proposals / Re: Object member functons
« on: January 07, 2011, 08:55:20 pm »Suppose f1 and f2 return 0, and obj2.array[0,0] = 0.f1() is performed for all objects, f2() is performed for objects, and set to a for all objects. It would be expansion hell, and really, in the end, the last one executed would actually be stored. That's why it's a bad idea to make one variable operate on multiple objects.
The statement would be equivalent to the following:
obj1.a = 0;
As you can see, I'm totally lost, which is why someone needs to explain this one to me.
180
Proposals / Re: Object member functons
« on: January 07, 2011, 08:54:16 pm »
It would be expansion hell.
Now, that makes sense, I guess.
with() will do what it will, I suppose.
Now, that makes sense, I guess.
with() will do what it will, I suppose.