LaeMVP
|
  |
| Joined: 24 Jun 2013 |
| Total Posts: 4416 |
|
|
| 28 Nov 2017 03:42 PM |
CFrame api, the methods and the syntax needs to be updated, anyone know if there is a specific reason for why you're multiplying CFrames to add them instead of just them adding __add and __sub, also :inverse() vs __unm?
Color3 api, the methods and syntax needs to be updated, should-be deprecated methods are still lurking there just like CFrame, and the syntax not have like anything idk why it wouldn't have add and sub, maybe there is a reason?
Any more? |
|
|
| Report Abuse |
|
|
gunter5
|
  |
| Joined: 15 Mar 2011 |
| Total Posts: 737 |
|
|
| 28 Nov 2017 04:43 PM |
| I agree, it makes more sense to use CFrame_add() or CFrame.add() instead of multiplying two CFrames together. Color3 isn't as bad as CFrame imo. |
|
|
| Report Abuse |
|
|
LaeMVP
|
  |
| Joined: 24 Jun 2013 |
| Total Posts: 4416 |
|
|
| 28 Nov 2017 04:49 PM |
no i meant using metatables not having a function for it directly like that
also if anything Color3 is worse because you can do like nothing with it in terms of like operators |
|
|
| Report Abuse |
|
|
TaaRt
|
  |
| Joined: 26 Apr 2009 |
| Total Posts: 5039 |
|
|
| 28 Nov 2017 04:51 PM |
| Glad to see Color3 get adressed the same day it was brought up. Who actually has the knowledge as to why it didn't have these methods to begin with? |
|
|
| Report Abuse |
|
|
LaeMVP
|
  |
| Joined: 24 Jun 2013 |
| Total Posts: 4416 |
|
|
| 28 Nov 2017 04:53 PM |
| I can't tell if you're being sarcastic or honest, I think honest but heck xd |
|
|
| Report Abuse |
|
|
Quasiduck
|
  |
| Joined: 28 Sep 2008 |
| Total Posts: 2437 |
|
|
| 28 Nov 2017 04:59 PM |
I don't know the specific reason for why we can't add CFrames but it would probably be to do with the fact that when changing a part's CFrame, all entries must produce an orthonormal basis out of the three column vectors in a CFrame's rotation matrix. Hence, if you try adding a CFrame to another, it will break that orthonormality (in general) and glitch your part out.
Matrix multiplication makes a lot more sense as it encodes changing from one orientation to some other object's orientation.
The reason you're probably thinking as to why CFrame*CFrame works as adding them and CFrame*CFrame:inverse() works as subtraction is because of how CFrame multiplication (matrix multiplication) works. Also, CFrame*CFrame does not produce the correct sum of their position vectors in general.
They would probably assume that if you just wanted to add the positional part of a CFrame to another. You can just do part.CFrame = CFrame.new() + CFrame.p + CFrame.p or part.CFrame = CFrame.new(CFrame.p + CFrame.p). |
|
|
| Report Abuse |
|
|
TaaRt
|
  |
| Joined: 26 Apr 2009 |
| Total Posts: 5039 |
|
|
| 28 Nov 2017 05:00 PM |
| Well I'm definitely honestly wondering who created it without these (somewhat obvious) methods added. I guess I'm fairly curious whether we are overlooking some big issue with implementing them as is |
|
|
| Report Abuse |
|
|
Quasiduck
|
  |
| Joined: 28 Sep 2008 |
| Total Posts: 2437 |
|
|
| 28 Nov 2017 05:01 PM |
| ^CFrame.p and CFrame.p were supposed to be distinct cframes but filter. |
|
|
| Report Abuse |
|
|
cabbler
|
  |
| Joined: 19 Jun 2015 |
| Total Posts: 735 |
|
|
| 28 Nov 2017 05:02 PM |
| I agree about CFrames. The multiplication sign for addition makes no sense, especially if they are treated like matrices. For color3 the idea is they are in fact not math objects but simple containers. |
|
|
| Report Abuse |
|
|
K7Q
|
  |
| Joined: 23 Mar 2013 |
| Total Posts: 5546 |
|
|
| 28 Nov 2017 05:04 PM |
| Color3 is just atrocious, it needs to be completley redone and same with Cframe with its extremely confusing rotation matrix. not sure why vector3 exists though |
|
|
| Report Abuse |
|
|
TaaRt
|
  |
| Joined: 26 Apr 2009 |
| Total Posts: 5039 |
|
|
| 28 Nov 2017 05:05 PM |
| @cabbler for Color3 I guess it'd boil down to whether the intended design obeys what we'd find a useful utility. As far as practical applications go though, I can't see why it shouldn't be added (even if it has to follow some naming convenience to be more truthful to the design meaning it'd not be in metamethods) |
|
|
| Report Abuse |
|
|
K7Q
|
  |
| Joined: 23 Mar 2013 |
| Total Posts: 5546 |
|
|
| 28 Nov 2017 05:08 PM |
| Also add MaterialType and Enum to the list, dont know why Enum even exists beyond that TBH its superrr annoying. |
|
|
| Report Abuse |
|
|
|
| 28 Nov 2017 05:09 PM |
| You can simply make your own addition for cframes using metatables. |
|
|
| Report Abuse |
|
|
LaeMVP
|
  |
| Joined: 24 Jun 2013 |
| Total Posts: 4416 |
|
|
| 28 Nov 2017 05:09 PM |
Yeah but what if you wanted to add the values of two Color3s together, I thought there was a reason behind the cf*cf thing but I wasn't really certain,
but I don't really see any reason for cf:inverse() it does like
-r00,r01,r02,r10,-r11,r12,r20,r21,-r22
or so I think at least from my testing
Also they need to update the methods for both of the apis so that they work with their casing |
|
|
| Report Abuse |
|
|
cntkillme
|
  |
| Joined: 07 Apr 2008 |
| Total Posts: 44956 |
|
|
| 28 Nov 2017 05:10 PM |
"CFrame api, the methods and the syntax needs to be updated" You mean their method names should be PascalCase? Yes I agree.
"anyone know if there is a specific reason for why you're multiplying CFrames to add them instead of just them adding __add and __sub, also :inverse() vs __unm?" First of all, adding CFrames makes no sense. Multiplying CFrames does. It's called compositions of linear transformations. Inverse is less misleading than unm, considering inverse is not just "invert all the components" because that's not how it works and makes no sense.
"Color3 api, the methods and syntax needs to be updated, should-be deprecated methods are still lurking there just like CFrame, and the syntax not have like anything idk why it wouldn't have add and sub, maybe there is a reason?" What? What's wrong with Roblox's Color3? Nothing of Color3 should or even is deprecated, and Roblox doesn't remove deprecated features so old games still work. And adding colors doesn't make sense since there's more than 1 way to approach it.
|
|
|
| Report Abuse |
|
|
cntkillme
|
  |
| Joined: 07 Apr 2008 |
| Total Posts: 44956 |
|
|
| 28 Nov 2017 05:17 PM |
"I agree about CFrames. The multiplication sign for addition makes no sense" What? It's literally matrix MULTIPLICATION going on behind the scenes.
"Color3 is just atrocious, it needs to be completley redone and same with Cframe with its extremely confusing rotation matrix. not sure why vector3 exists though" Again, what's so wrong with Color3? And What's wrong with CFrame? It's not extremely confusing you just don't know how rotational matrices work. The columns of a rotation matrix are the (typically orthonormal) basis vectors that describe the orientation of the coordinate system, that's all.
And what do you mean not sure why Vector3 exists? Every 3 dimensional object takes a Vector3. Size, Position, Axes (i.e. when calling CFrame.fromAxisAngle, etc.), Velocity, Torque, Force, etc.
"Yeah but what if you wanted to add the values of two Color3s together, I thought there was a reason behind the cf*cf thing but I wasn't really certain, " Again adding 2 Color3s has many different interpretations and is thus better left undefined.
"but I don't really see any reason for cf:inverse() it does like
-r00,r01,r02,r10,-r11,r12,r20,r21,-r22" Not even sort of. It takes the transpose of the rotational part of the matrix and also applies the ######## of that to the position to resolve the new position.
|
|
|
| Report Abuse |
|
|
LaeMVP
|
  |
| Joined: 24 Jun 2013 |
| Total Posts: 4416 |
|
|
| 28 Nov 2017 05:17 PM |
| It was me more asking questions than saying "this needs to be fixed", also by should-be deprecated methods lurking there I meant like fromRGB and fromHSV, I feel like they should be deprecated because of the camel, does that follow robloxs casing? Thanks for answering my questions :weeb:, ty vampire ##### xd |
|
|
| Report Abuse |
|
|
cntkillme
|
  |
| Joined: 07 Apr 2008 |
| Total Posts: 44956 |
|
|
| 28 Nov 2017 05:18 PM |
No, constructors and just table functions in general have always been camelCase. It's methods that are PascalCase.
So it's fine as it is. |
|
|
| Report Abuse |
|
|
LaeMVP
|
  |
| Joined: 24 Jun 2013 |
| Total Posts: 4416 |
|
|
| 28 Nov 2017 05:21 PM |
| yeah I thought so once I thought of new, it(fromRGB and fromHSV) just feels like something that should be in pascal to me idk |
|
|
| Report Abuse |
|
|
Quasiduck
|
  |
| Joined: 28 Sep 2008 |
| Total Posts: 2437 |
|
|
| 28 Nov 2017 05:23 PM |
It's because the multiplication sign isn't actually addition. @cabbler
You can just use it in some cases to produce addition of two CFrames (of the positional part(s) of those CFrames which is CFrame.p).
e.g.
cf*CFrame.new(1,1,1) will translate the position of cf by 1 stud in the local space of cf. i.e. It will be translated by 1 stud in the directions of cf.upVector, cf.rightVector and -cf.lookVector |
|
|
| Report Abuse |
|
|
cabbler
|
  |
| Joined: 19 Jun 2015 |
| Total Posts: 735 |
|
|
| 28 Nov 2017 05:32 PM |
| Sorry for a second I thought they added the matrices and I was wrong. The multiplication makes sense. __add could be more intuitive for the humans tho. |
|
|
| Report Abuse |
|
|
cntkillme
|
  |
| Joined: 07 Apr 2008 |
| Total Posts: 44956 |
|
|
| 28 Nov 2017 05:32 PM |
| how would it be more intuitive? it would more misleading if anything. |
|
|
| Report Abuse |
|
|
|
| 28 Nov 2017 05:42 PM |
| CFrame. Yeah, we are talking about a Tridimensional resourse.. so.. the multiplication make sense when you study it a bit more, However it must be optimized. |
|
|
| Report Abuse |
|
|
LaeMVP
|
  |
| Joined: 24 Jun 2013 |
| Total Posts: 4416 |
|
|
| 28 Nov 2017 05:50 PM |
| The methods for CFrame need to be updated to pascal for sure though |
|
|
| Report Abuse |
|
|
cabbler
|
  |
| Joined: 19 Jun 2015 |
| Total Posts: 735 |
|
|
| 28 Nov 2017 05:55 PM |
| Since at the end of the day the rotation offset looks like addition. Only misleading if you look at the values, but I know what you mean. It was only a thought. |
|
|
| Report Abuse |
|
|