Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Matrix comparison operators #42

Closed
jonathansty opened this issue Jan 23, 2021 · 1 comment
Closed

Matrix comparison operators #42

jonathansty opened this issue Jan 23, 2021 · 1 comment
Assignees
Labels

Comments

@jonathansty
Copy link

jonathansty commented Jan 23, 2021

Matrices currently do not have any comparison operators defined for them. I can get around it by writing my own operators manually but it would be nice if these were built-in in hlslpp.

Build output

1>C:\Personal\ElectronicJonaJoy\src\EngineTests\math.tests.cpp(67,1): error C2678: binary '==': no operator found which takes a left-hand operand of type 'hlslpp::float4x4' (or there is no acceptable conversion)
1>c:\personal\electronicjonajoy\external\hlslpp\include\hlsl++_vector_float.h(1122,23): message : could be 'hlslpp::float1 hlslpp::operator ==(const hlslpp::float1 &,const hlslpp::float1 &)' [found using argument-dependent lookup]
1>c:\personal\electronicjonajoy\external\hlslpp\include\hlsl++_vector_float.h(1123,23): message : or       'hlslpp::float2 hlslpp::operator ==(const hlslpp::float2 &,const hlslpp::float2 &)' [found using argument-dependent lookup]
1>c:\personal\electronicjonajoy\external\hlslpp\include\hlsl++_vector_float.h(1124,23): message : or       'hlslpp::float3 hlslpp::operator ==(const hlslpp::float3 &,const hlslpp::float3 &)' [found using argument-dependent lookup]
1>c:\personal\electronicjonajoy\external\hlslpp\include\hlsl++_vector_float.h(1125,23): message : or       'hlslpp::float4 hlslpp::operator ==(const hlslpp::float4 &,const hlslpp::float4 &)' [found using argument-dependent lookup]
1>c:\personal\electronicjonajoy\external\hlslpp\include\hlsl++_vector_int.h(568,21): message : or       'hlslpp::int1 hlslpp::operator ==(const hlslpp::int1 &,const hlslpp::int1 &)' [found using argument-dependent lookup]
1>c:\personal\electronicjonajoy\external\hlslpp\include\hlsl++_vector_int.h(569,21): message : or       'hlslpp::int2 hlslpp::operator ==(const hlslpp::int2 &,const hlslpp::int2 &)' [found using argument-dependent lookup]
1>c:\personal\electronicjonajoy\external\hlslpp\include\hlsl++_vector_int.h(570,21): message : or       'hlslpp::int3 hlslpp::operator ==(const hlslpp::int3 &,const hlslpp::int3 &)' [found using argument-dependent lookup]
1>c:\personal\electronicjonajoy\external\hlslpp\include\hlsl++_vector_int.h(571,21): message : or       'hlslpp::int4 hlslpp::operator ==(const hlslpp::int4 &,const hlslpp::int4 &)' [found using argument-dependent lookup]
1>c:\personal\electronicjonajoy\external\hlslpp\include\hlsl++_vector_uint.h(573,22): message : or       'hlslpp::uint1 hlslpp::operator ==(const hlslpp::uint1 &,const hlslpp::uint1 &)' [found using argument-dependent lookup]
1>c:\personal\electronicjonajoy\external\hlslpp\include\hlsl++_vector_uint.h(574,22): message : or       'hlslpp::uint2 hlslpp::operator ==(const hlslpp::uint2 &,const hlslpp::uint2 &)' [found using argument-dependent lookup]
1>c:\personal\electronicjonajoy\external\hlslpp\include\hlsl++_vector_uint.h(575,22): message : or       'hlslpp::uint3 hlslpp::operator ==(const hlslpp::uint3 &,const hlslpp::uint3 &)' [found using argument-dependent lookup]
1>c:\personal\electronicjonajoy\external\hlslpp\include\hlsl++_vector_uint.h(576,22): message : or       'hlslpp::uint4 hlslpp::operator ==(const hlslpp::uint4 &,const hlslpp::uint4 &)' [found using argument-dependent lookup]
1>c:\personal\electronicjonajoy\external\hlslpp\include\hlsl++_vector_double.h(1079,24): message : or       'hlslpp::double1 hlslpp::operator ==(const hlslpp::double1 &,const hlslpp::double1 &)' [found using argument-dependent lookup]
1>c:\personal\electronicjonajoy\external\hlslpp\include\hlsl++_vector_double.h(1080,24): message : or       'hlslpp::double2 hlslpp::operator ==(const hlslpp::double2 &,const hlslpp::double2 &)' [found using argument-dependent lookup]
1>c:\personal\electronicjonajoy\external\hlslpp\include\hlsl++_vector_double.h(1081,24): message : or       'hlslpp::double3 hlslpp::operator ==(const hlslpp::double3 &,const hlslpp::double3 &)' [found using argument-dependent lookup]
1>c:\personal\electronicjonajoy\external\hlslpp\include\hlsl++_vector_double.h(1090,24): message : or       'hlslpp::double4 hlslpp::operator ==(const hlslpp::double4 &,const hlslpp::double4 &)' [found using argument-dependent lookup]
1>c:\personal\electronicjonajoy\external\hlslpp\include\hlsl++_quaternion.h(227,24): message : or       'hlslpp::float4 hlslpp::operator ==(const hlslpp::quaternion &,const hlslpp::quaternion &)' [found using argument-dependent lookup]
1>C:\Personal\ElectronicJonaJoy\src\EngineTests\math.tests.cpp(67,1): message : while trying to match the argument list '(hlslpp::float4x4, hlslpp::float4x4)'
@redorav redorav self-assigned this Jan 23, 2021
@redorav
Copy link
Owner

redorav commented Jan 23, 2021

@jonathansty I have implemented comparison operators for the square matrices and added any/all functions should you need to check whether all or any of the components are != 0. I'll get around to adding them for all other matrices at some point.

Fixed via ccaa72c

@redorav redorav closed this as completed Jan 23, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants