Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
Alchemy Viewer
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Silent mode is enabled
All outbound communications are blocked.
Learn more
.
Show more breadcrumbs
Testicular Slingshot
Alchemy Viewer
Commits
5334a178
Commit
5334a178
authored
10 years ago
by
Drake Arconis
Browse files
Options
Downloads
Patches
Plain Diff
Minor cleanup
parent
dd3d53b9
No related branches found
No related tags found
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
indra/llcommon/llpredicate.h
+2
-5
2 additions, 5 deletions
indra/llcommon/llpredicate.h
indra/llcommon/llunittype.h
+48
-46
48 additions, 46 deletions
indra/llcommon/llunittype.h
indra/llmath/lloctree.h
+7
-7
7 additions, 7 deletions
indra/llmath/lloctree.h
with
57 additions
and
58 deletions
indra/llcommon/llpredicate.h
+
2
−
5
View file @
5334a178
...
...
@@ -139,12 +139,9 @@ namespace LLPredicate
Rule
()
{}
// <alchemy> Fix for linux compiler
// I don't know why this works on MSVC
void
require
(
ENUM
e
)
void
require
(
ENUM
e
,
bool
match
)
{
//mRule.set(e, require);
mRule
.
set
(
e
);
mRule
.
set
(
e
,
match
);
}
void
allow
(
ENUM
e
)
...
...
This diff is collapsed.
Click to expand it.
indra/llcommon/llunittype.h
+
48
−
46
View file @
5334a178
...
...
@@ -87,6 +87,40 @@ struct LLUnit
:
mValue
(
value
)
{}
LL_FORCE_INLINE
static
self_t
convert
(
self_t
v
)
{
return
v
;
}
template
<
typename
FROM_STORAGE_TYPE
>
LL_FORCE_INLINE
static
self_t
convert
(
LLUnit
<
FROM_STORAGE_TYPE
,
UNITS
>
v
)
{
self_t
result
;
result
.
mValue
=
(
STORAGE_TYPE
)
v
.
value
();
return
result
;
}
template
<
typename
FROM_UNITS
>
LL_FORCE_INLINE
static
self_t
convert
(
LLUnit
<
STORAGE_TYPE
,
FROM_UNITS
>
v
)
{
self_t
result
;
STORAGE_TYPE
divisor
=
ll_convert_units
(
v
,
result
);
result
.
mValue
/=
divisor
;
return
result
;
}
template
<
typename
FROM_STORAGE_TYPE
,
typename
FROM_UNITS
>
LL_FORCE_INLINE
static
self_t
convert
(
LLUnit
<
FROM_STORAGE_TYPE
,
FROM_UNITS
>
v
)
{
typedef
typename
LLResultTypePromote
<
FROM_STORAGE_TYPE
,
STORAGE_TYPE
>::
type_t
result_storage_t
;
LLUnit
<
result_storage_t
,
UNITS
>
result
;
result_storage_t
divisor
=
ll_convert_units
(
v
,
result
);
result
.
value
(
result
.
value
()
/
divisor
);
return
self_t
(
result
.
value
());
}
// unit initialization and conversion
template
<
typename
OTHER_STORAGE_TYPE
,
typename
OTHER_UNITS
>
LL_FORCE_INLINE
LLUnit
(
LLUnit
<
OTHER_STORAGE_TYPE
,
OTHER_UNITS
>
other
)
...
...
@@ -183,38 +217,6 @@ struct LLUnit
return
mValue
>=
convert
(
other
).
value
();
}
LL_FORCE_INLINE
static
self_t
convert
(
self_t
v
)
{
return
v
;
}
template
<
typename
FROM_STORAGE_TYPE
>
LL_FORCE_INLINE
static
self_t
convert
(
LLUnit
<
FROM_STORAGE_TYPE
,
UNITS
>
v
)
{
self_t
result
;
result
.
mValue
=
(
STORAGE_TYPE
)
v
.
value
();
return
result
;
}
template
<
typename
FROM_UNITS
>
LL_FORCE_INLINE
static
self_t
convert
(
LLUnit
<
STORAGE_TYPE
,
FROM_UNITS
>
v
)
{
self_t
result
;
STORAGE_TYPE
divisor
=
ll_convert_units
(
v
,
result
);
result
.
mValue
/=
divisor
;
return
result
;
}
template
<
typename
FROM_STORAGE_TYPE
,
typename
FROM_UNITS
>
LL_FORCE_INLINE
static
self_t
convert
(
LLUnit
<
FROM_STORAGE_TYPE
,
FROM_UNITS
>
v
)
{
typedef
typename
LLResultTypePromote
<
FROM_STORAGE_TYPE
,
STORAGE_TYPE
>::
type_t
result_storage_t
;
LLUnit
<
result_storage_t
,
UNITS
>
result
;
result_storage_t
divisor
=
ll_convert_units
(
v
,
result
);
result
.
value
(
result
.
value
()
/
divisor
);
return
self_t
(
result
.
value
());
}
protected
:
storage_t
mValue
;
};
...
...
@@ -269,7 +271,7 @@ struct LLUnitImplicit : public LLUnit<STORAGE_TYPE, UNITS>
template
<
typename
OTHER_STORAGE_TYPE
,
typename
OTHER_UNITS
>
LL_FORCE_INLINE
void
operator
+=
(
LLUnitImplicit
<
OTHER_STORAGE_TYPE
,
OTHER_UNITS
>
other
)
{
base_t
::
mValue
+=
this
->
convert
(
other
).
value
();
base_t
::
mValue
+=
base_t
::
convert
(
other
).
value
();
}
using
base_t
::
operator
-=
;
...
...
@@ -283,19 +285,19 @@ struct LLUnitImplicit : public LLUnit<STORAGE_TYPE, UNITS>
template
<
typename
OTHER_STORAGE_TYPE
,
typename
OTHER_UNITS
>
LL_FORCE_INLINE
void
operator
-=
(
LLUnitImplicit
<
OTHER_STORAGE_TYPE
,
OTHER_UNITS
>
other
)
{
base_t
::
mValue
-=
this
->
convert
(
other
).
value
();
base_t
::
mValue
-=
base_t
::
convert
(
other
).
value
();
}
template
<
typename
OTHER_STORAGE_TYPE
,
typename
OTHER_UNITS
>
LL_FORCE_INLINE
bool
operator
==
(
LLUnit
<
OTHER_STORAGE_TYPE
,
OTHER_UNITS
>
other
)
const
{
return
base_t
::
mValue
==
this
->
convert
(
other
).
value
();
return
base_t
::
mValue
==
base_t
::
convert
(
other
).
value
();
}
template
<
typename
OTHER_STORAGE_TYPE
,
typename
OTHER_UNITS
>
LL_FORCE_INLINE
bool
operator
==
(
LLUnitImplicit
<
OTHER_STORAGE_TYPE
,
OTHER_UNITS
>
other
)
const
{
return
base_t
::
mValue
==
this
->
convert
(
other
).
value
();
return
base_t
::
mValue
==
base_t
::
convert
(
other
).
value
();
}
template
<
typename
STORAGE_T
>
...
...
@@ -307,13 +309,13 @@ struct LLUnitImplicit : public LLUnit<STORAGE_TYPE, UNITS>
template
<
typename
OTHER_STORAGE_TYPE
,
typename
OTHER_UNITS
>
LL_FORCE_INLINE
bool
operator
!=
(
LLUnit
<
OTHER_STORAGE_TYPE
,
OTHER_UNITS
>
other
)
const
{
return
base_t
::
mValue
!=
this
->
convert
(
other
).
value
();
return
base_t
::
mValue
!=
convert
(
other
).
value
();
}
template
<
typename
OTHER_STORAGE_TYPE
,
typename
OTHER_UNITS
>
LL_FORCE_INLINE
bool
operator
!=
(
LLUnitImplicit
<
OTHER_STORAGE_TYPE
,
OTHER_UNITS
>
other
)
const
{
return
base_t
::
mValue
!=
this
->
convert
(
other
).
value
();
return
base_t
::
mValue
!=
base_t
::
convert
(
other
).
value
();
}
template
<
typename
STORAGE_T
>
...
...
@@ -325,13 +327,13 @@ struct LLUnitImplicit : public LLUnit<STORAGE_TYPE, UNITS>
template
<
typename
OTHER_STORAGE_TYPE
,
typename
OTHER_UNITS
>
LL_FORCE_INLINE
bool
operator
<
(
LLUnit
<
OTHER_STORAGE_TYPE
,
OTHER_UNITS
>
other
)
const
{
return
base_t
::
mValue
<
this
->
convert
(
other
).
value
();
return
base_t
::
mValue
<
base_t
::
convert
(
other
).
value
();
}
template
<
typename
OTHER_STORAGE_TYPE
,
typename
OTHER_UNITS
>
LL_FORCE_INLINE
bool
operator
<
(
LLUnitImplicit
<
OTHER_STORAGE_TYPE
,
OTHER_UNITS
>
other
)
const
{
return
base_t
::
mValue
<
this
->
convert
(
other
).
value
();
return
base_t
::
mValue
<
base_t
::
convert
(
other
).
value
();
}
template
<
typename
STORAGE_T
>
...
...
@@ -343,13 +345,13 @@ struct LLUnitImplicit : public LLUnit<STORAGE_TYPE, UNITS>
template
<
typename
OTHER_STORAGE_TYPE
,
typename
OTHER_UNITS
>
LL_FORCE_INLINE
bool
operator
<=
(
LLUnit
<
OTHER_STORAGE_TYPE
,
OTHER_UNITS
>
other
)
const
{
return
base_t
::
mValue
<=
this
->
convert
(
other
).
value
();
return
base_t
::
mValue
<=
base_t
::
convert
(
other
).
value
();
}
template
<
typename
OTHER_STORAGE_TYPE
,
typename
OTHER_UNITS
>
LL_FORCE_INLINE
bool
operator
<=
(
LLUnitImplicit
<
OTHER_STORAGE_TYPE
,
OTHER_UNITS
>
other
)
const
{
return
base_t
::
mValue
<=
this
->
convert
(
other
).
value
();
return
base_t
::
mValue
<=
base_t
::
convert
(
other
).
value
();
}
template
<
typename
STORAGE_T
>
...
...
@@ -361,13 +363,13 @@ struct LLUnitImplicit : public LLUnit<STORAGE_TYPE, UNITS>
template
<
typename
OTHER_STORAGE_TYPE
,
typename
OTHER_UNITS
>
LL_FORCE_INLINE
bool
operator
>
(
LLUnit
<
OTHER_STORAGE_TYPE
,
OTHER_UNITS
>
other
)
const
{
return
base_t
::
mValue
>
this
->
convert
(
other
).
value
();
return
base_t
::
mValue
>
base_t
::
convert
(
other
).
value
();
}
template
<
typename
OTHER_STORAGE_TYPE
,
typename
OTHER_UNITS
>
LL_FORCE_INLINE
bool
operator
>
(
LLUnitImplicit
<
OTHER_STORAGE_TYPE
,
OTHER_UNITS
>
other
)
const
{
return
base_t
::
mValue
>
this
->
convert
(
other
).
value
();
return
base_t
::
mValue
>
base_t
::
convert
(
other
).
value
();
}
template
<
typename
STORAGE_T
>
...
...
@@ -379,13 +381,13 @@ struct LLUnitImplicit : public LLUnit<STORAGE_TYPE, UNITS>
template
<
typename
OTHER_STORAGE_TYPE
,
typename
OTHER_UNITS
>
LL_FORCE_INLINE
bool
operator
>=
(
LLUnit
<
OTHER_STORAGE_TYPE
,
OTHER_UNITS
>
other
)
const
{
return
base_t
::
mValue
>=
this
->
convert
(
other
).
value
();
return
base_t
::
mValue
>=
base_t
::
convert
(
other
).
value
();
}
template
<
typename
OTHER_STORAGE_TYPE
,
typename
OTHER_UNITS
>
LL_FORCE_INLINE
bool
operator
>=
(
LLUnitImplicit
<
OTHER_STORAGE_TYPE
,
OTHER_UNITS
>
other
)
const
{
return
base_t
::
mValue
>=
this
->
convert
(
other
).
value
();
return
base_t
::
mValue
>=
base_t
::
convert
(
other
).
value
();
}
template
<
typename
STORAGE_T
>
...
...
This diff is collapsed.
Click to expand it.
indra/llmath/lloctree.h
+
7
−
7
View file @
5334a178
...
...
@@ -353,8 +353,8 @@ public:
//is it here?
if
(
isInside
(
data
->
getPositionGroup
()))
{
if
(((
(
getElementCount
()
<
gOctreeMaxCapacity
||
getSize
()[
0
]
<=
gOctreeMinSize
)
&&
contains
(
data
->
getBinRadius
()))
||
(
data
->
getBinRadius
()
>
getSize
()[
0
]
&&
parent
&&
parent
->
getElementCount
()
>=
gOctreeMaxCapacity
)))
if
(((
getElementCount
()
<
gOctreeMaxCapacity
||
((
getSize
()[
0
]
<=
gOctreeMinSize
)
&&
contains
(
data
->
getBinRadius
()))
)
||
(
(
data
->
getBinRadius
()
>
getSize
()[
0
]
&&
parent
&&
parent
->
getElementCount
()
>=
gOctreeMaxCapacity
)))
)
{
//it belongs here
mData
.
push_back
(
NULL
);
mData
[
mElementCount
]
=
data
;
...
...
@@ -476,7 +476,7 @@ public:
mDataEnd
=
&
mData
[
0
];
}
this
->
notifyRemoval
(
data
);
BaseType
::
notifyRemoval
(
data
);
checkAlive
();
}
...
...
@@ -806,10 +806,10 @@ public:
return
false
;
}
if
(
this
->
getSize
()[
0
]
>
data
->
getBinRadius
()
&&
this
->
isInside
(
data
->
getPositionGroup
()))
if
(
this
->
getSize
()[
0
]
>
data
->
getBinRadius
()
&&
oct_node
::
isInside
(
data
->
getPositionGroup
()))
{
//we got it, just act like a branch
oct_node
*
node
=
this
->
getNodeAt
(
data
);
oct_node
*
node
=
oct_node
::
getNodeAt
(
data
);
if
(
node
==
this
)
{
LLOctreeNode
<
T
>::
insert
(
data
);
...
...
@@ -822,7 +822,7 @@ public:
else
if
(
this
->
getChildCount
()
==
0
)
{
//first object being added, just wrap it up
while
(
!
(
this
->
getSize
()[
0
]
>
data
->
getBinRadius
()
&&
this
->
isInside
(
data
->
getPositionGroup
())))
while
(
!
(
this
->
getSize
()[
0
]
>
data
->
getBinRadius
()
&&
oct_node
::
isInside
(
data
->
getPositionGroup
())))
{
LLVector4a
center
,
size
;
center
=
this
->
getCenter
();
...
...
@@ -837,7 +837,7 @@ public:
}
else
{
while
(
!
(
this
->
getSize
()[
0
]
>
data
->
getBinRadius
()
&&
this
->
isInside
(
data
->
getPositionGroup
())))
while
(
!
(
this
->
getSize
()[
0
]
>
data
->
getBinRadius
()
&&
oct_node
::
isInside
(
data
->
getPositionGroup
())))
{
//the data is outside the root node, we need to grow
LLVector4a
center
(
this
->
getCenter
());
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment