Format engine codebase with ReSharper
This commit is contained in:
@@ -17,18 +17,15 @@ API_CLASS(InBuild) class Array
|
|||||||
{
|
{
|
||||||
friend Array;
|
friend Array;
|
||||||
public:
|
public:
|
||||||
|
|
||||||
typedef T ItemType;
|
typedef T ItemType;
|
||||||
typedef typename AllocationType::template Data<T> AllocationData;
|
typedef typename AllocationType::template Data<T> AllocationData;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
|
||||||
int32 _count;
|
int32 _count;
|
||||||
int32 _capacity;
|
int32 _capacity;
|
||||||
AllocationData _allocation;
|
AllocationData _allocation;
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Initializes a new instance of the <see cref="Array"/> class.
|
/// Initializes a new instance of the <see cref="Array"/> class.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
@@ -208,7 +205,6 @@ public:
|
|||||||
}
|
}
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Gets the amount of the items in the collection.
|
/// Gets the amount of the items in the collection.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
@@ -334,7 +330,6 @@ public:
|
|||||||
}
|
}
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
|
||||||
FORCE_INLINE T* begin()
|
FORCE_INLINE T* begin()
|
||||||
{
|
{
|
||||||
return &_allocation.Get()[0];
|
return &_allocation.Get()[0];
|
||||||
@@ -356,7 +351,6 @@ public:
|
|||||||
}
|
}
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Clear the collection without changing its capacity.
|
/// Clear the collection without changing its capacity.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
@@ -738,7 +732,6 @@ public:
|
|||||||
}
|
}
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Performs push on stack operation (stack grows at the end of the collection).
|
/// Performs push on stack operation (stack grows at the end of the collection).
|
||||||
/// </summary>
|
/// </summary>
|
||||||
@@ -777,7 +770,6 @@ public:
|
|||||||
}
|
}
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Performs enqueue to queue operation (queue head is in the beginning of queue).
|
/// Performs enqueue to queue operation (queue head is in the beginning of queue).
|
||||||
/// </summary>
|
/// </summary>
|
||||||
@@ -800,7 +792,6 @@ public:
|
|||||||
}
|
}
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Searches for the given item within the entire collection.
|
/// Searches for the given item within the entire collection.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
@@ -869,7 +860,6 @@ public:
|
|||||||
}
|
}
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
|
||||||
bool operator==(const Array& other) const
|
bool operator==(const Array& other) const
|
||||||
{
|
{
|
||||||
if (_count == other._count)
|
if (_count == other._count)
|
||||||
@@ -891,7 +881,6 @@ public:
|
|||||||
}
|
}
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// The collection iterator.
|
/// The collection iterator.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
@@ -915,7 +904,6 @@ public:
|
|||||||
}
|
}
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
|
||||||
Iterator()
|
Iterator()
|
||||||
: _array(nullptr)
|
: _array(nullptr)
|
||||||
, _index(-1)
|
, _index(-1)
|
||||||
@@ -935,7 +923,6 @@ public:
|
|||||||
}
|
}
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
|
||||||
FORCE_INLINE Array* GetArray() const
|
FORCE_INLINE Array* GetArray() const
|
||||||
{
|
{
|
||||||
return _array;
|
return _array;
|
||||||
@@ -1008,7 +995,6 @@ public:
|
|||||||
};
|
};
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Gets iterator for beginning of the collection.
|
/// Gets iterator for beginning of the collection.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
|||||||
@@ -17,11 +17,9 @@ class IGrouping : public Array<TSource>
|
|||||||
friend ArrayExtensions;
|
friend ArrayExtensions;
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
|
|
||||||
TKey _key;
|
TKey _key;
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Gets the common key.
|
/// Gets the common key.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
@@ -47,7 +45,6 @@ public:
|
|||||||
class ArrayExtensions
|
class ArrayExtensions
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Searches for the specified object using a custom query and returns the zero-based index of the first occurrence within the entire collection.
|
/// Searches for the specified object using a custom query and returns the zero-based index of the first occurrence within the entire collection.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
|||||||
@@ -15,18 +15,15 @@ API_CLASS(InBuild) class BitArray
|
|||||||
friend BitArray;
|
friend BitArray;
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
|
||||||
typedef uint64 ItemType;
|
typedef uint64 ItemType;
|
||||||
typedef typename AllocationType::template Data<ItemType> AllocationData;
|
typedef typename AllocationType::template Data<ItemType> AllocationData;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
|
||||||
int32 _count;
|
int32 _count;
|
||||||
int32 _capacity;
|
int32 _capacity;
|
||||||
AllocationData _allocation;
|
AllocationData _allocation;
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Initializes a new instance of the <see cref="BitArray"/> class.
|
/// Initializes a new instance of the <see cref="BitArray"/> class.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
@@ -119,7 +116,6 @@ public:
|
|||||||
}
|
}
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Gets the pointer to the bits storage data (linear allocation).
|
/// Gets the pointer to the bits storage data (linear allocation).
|
||||||
/// </summary>
|
/// </summary>
|
||||||
@@ -216,7 +212,6 @@ public:
|
|||||||
}
|
}
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Clear the collection without changing its capacity.
|
/// Clear the collection without changing its capacity.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
|||||||
@@ -17,7 +17,6 @@ class ChunkedArray
|
|||||||
friend ChunkedArray;
|
friend ChunkedArray;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
|
||||||
// TODO: don't use Array but small struct and don't InlinedArray or Chunk* but Chunk (less dynamic allocations)
|
// TODO: don't use Array but small struct and don't InlinedArray or Chunk* but Chunk (less dynamic allocations)
|
||||||
typedef Array<T> Chunk;
|
typedef Array<T> Chunk;
|
||||||
|
|
||||||
@@ -25,7 +24,6 @@ private:
|
|||||||
Array<Chunk*, InlinedAllocation<32>> _chunks;
|
Array<Chunk*, InlinedAllocation<32>> _chunks;
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
|
||||||
ChunkedArray()
|
ChunkedArray()
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
@@ -36,7 +34,6 @@ public:
|
|||||||
}
|
}
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Gets the amount of the elements in the collection.
|
/// Gets the amount of the elements in the collection.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
@@ -70,7 +67,6 @@ public:
|
|||||||
}
|
}
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
|
||||||
// Gets element by index
|
// Gets element by index
|
||||||
FORCE_INLINE T& At(int32 index) const
|
FORCE_INLINE T& At(int32 index) const
|
||||||
{
|
{
|
||||||
@@ -93,7 +89,6 @@ public:
|
|||||||
}
|
}
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Chunked array iterator.
|
/// Chunked array iterator.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
@@ -102,7 +97,6 @@ public:
|
|||||||
friend ChunkedArray;
|
friend ChunkedArray;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
|
||||||
ChunkedArray* _collection;
|
ChunkedArray* _collection;
|
||||||
int32 _chunkIndex;
|
int32 _chunkIndex;
|
||||||
int32 _index;
|
int32 _index;
|
||||||
@@ -115,7 +109,6 @@ public:
|
|||||||
}
|
}
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
|
||||||
Iterator()
|
Iterator()
|
||||||
: _collection(nullptr)
|
: _collection(nullptr)
|
||||||
, _chunkIndex(INVALID_INDEX)
|
, _chunkIndex(INVALID_INDEX)
|
||||||
@@ -131,7 +124,6 @@ public:
|
|||||||
}
|
}
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
|
||||||
FORCE_INLINE ChunkedArray* GetChunkedArray() const
|
FORCE_INLINE ChunkedArray* GetChunkedArray() const
|
||||||
{
|
{
|
||||||
return _collection;
|
return _collection;
|
||||||
@@ -143,7 +135,6 @@ public:
|
|||||||
}
|
}
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
|
||||||
bool IsEnd() const
|
bool IsEnd() const
|
||||||
{
|
{
|
||||||
ASSERT(_collection);
|
ASSERT(_collection);
|
||||||
@@ -157,7 +148,6 @@ public:
|
|||||||
}
|
}
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
|
||||||
FORCE_INLINE T& operator*() const
|
FORCE_INLINE T& operator*() const
|
||||||
{
|
{
|
||||||
return _collection->_chunks[_chunkIndex]->At(_index);
|
return _collection->_chunks[_chunkIndex]->At(_index);
|
||||||
@@ -169,7 +159,6 @@ public:
|
|||||||
}
|
}
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
|
||||||
FORCE_INLINE bool operator==(const Iterator& v) const
|
FORCE_INLINE bool operator==(const Iterator& v) const
|
||||||
{
|
{
|
||||||
return _collection == v._collection && _chunkIndex == v._chunkIndex && _index == v._index;
|
return _collection == v._collection && _chunkIndex == v._chunkIndex && _index == v._index;
|
||||||
@@ -181,7 +170,6 @@ public:
|
|||||||
}
|
}
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
|
||||||
Iterator& operator++()
|
Iterator& operator++()
|
||||||
{
|
{
|
||||||
ASSERT(_collection);
|
ASSERT(_collection);
|
||||||
@@ -280,7 +268,6 @@ public:
|
|||||||
};
|
};
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Adds the specified item to the collection.
|
/// Adds the specified item to the collection.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
@@ -482,7 +469,6 @@ public:
|
|||||||
}
|
}
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
|
||||||
Iterator Begin() const
|
Iterator Begin() const
|
||||||
{
|
{
|
||||||
return Iterator(this, 0);
|
return Iterator(this, 0);
|
||||||
|
|||||||
@@ -39,7 +39,6 @@ template<typename T, CollectionPoolCacheUtils::ClearCallback<T> ClearCallback =
|
|||||||
class CollectionPoolCache
|
class CollectionPoolCache
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Helper object used to access the pooled collection and return it to the pool after usage (on code scope execution end).
|
/// Helper object used to access the pooled collection and return it to the pool after usage (on code scope execution end).
|
||||||
/// </summary>
|
/// </summary>
|
||||||
@@ -48,7 +47,6 @@ public:
|
|||||||
friend CollectionPoolCache;
|
friend CollectionPoolCache;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
|
||||||
CollectionPoolCache* _pool;
|
CollectionPoolCache* _pool;
|
||||||
|
|
||||||
ScopeCache(CollectionPoolCache* pool, T* value)
|
ScopeCache(CollectionPoolCache* pool, T* value)
|
||||||
@@ -58,7 +56,6 @@ public:
|
|||||||
}
|
}
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
|
||||||
T* Value;
|
T* Value;
|
||||||
|
|
||||||
ScopeCache() = delete;
|
ScopeCache() = delete;
|
||||||
@@ -99,7 +96,6 @@ public:
|
|||||||
};
|
};
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
|
||||||
CriticalSection _locker;
|
CriticalSection _locker;
|
||||||
Array<T*, InlinedAllocation<64>> _pool;
|
Array<T*, InlinedAllocation<64>> _pool;
|
||||||
|
|
||||||
@@ -111,7 +107,6 @@ private:
|
|||||||
}
|
}
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Finalizes an instance of the <see cref="CollectionPoolCache"/> class.
|
/// Finalizes an instance of the <see cref="CollectionPoolCache"/> class.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
@@ -121,7 +116,6 @@ public:
|
|||||||
}
|
}
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Gets the collection instance from the pool. Can reuse the object from the pool or create a new one. Returns collection is always cleared and ready to use.
|
/// Gets the collection instance from the pool. Can reuse the object from the pool or create a new one. Returns collection is always cleared and ready to use.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
|||||||
@@ -18,7 +18,6 @@ API_CLASS(InBuild) class Dictionary
|
|||||||
{
|
{
|
||||||
friend Dictionary;
|
friend Dictionary;
|
||||||
public:
|
public:
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Describes single portion of space for the key and value pair in a hash map.
|
/// Describes single portion of space for the key and value pair in a hash map.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
@@ -106,14 +105,12 @@ public:
|
|||||||
typedef typename AllocationType::template Data<Bucket> AllocationData;
|
typedef typename AllocationType::template Data<Bucket> AllocationData;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
|
||||||
int32 _elementsCount = 0;
|
int32 _elementsCount = 0;
|
||||||
int32 _deletedCount = 0;
|
int32 _deletedCount = 0;
|
||||||
int32 _size = 0;
|
int32 _size = 0;
|
||||||
AllocationData _allocation;
|
AllocationData _allocation;
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Initializes a new instance of the <see cref="Dictionary"/> class.
|
/// Initializes a new instance of the <see cref="Dictionary"/> class.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
@@ -200,7 +197,6 @@ public:
|
|||||||
}
|
}
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Gets the amount of the elements in the collection.
|
/// Gets the amount of the elements in the collection.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
@@ -234,7 +230,6 @@ public:
|
|||||||
}
|
}
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// The Dictionary collection iterator.
|
/// The Dictionary collection iterator.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
@@ -359,7 +354,6 @@ public:
|
|||||||
};
|
};
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Gets element by the key (will add default ValueType element if key not found).
|
/// Gets element by the key (will add default ValueType element if key not found).
|
||||||
/// </summary>
|
/// </summary>
|
||||||
@@ -460,7 +454,6 @@ public:
|
|||||||
}
|
}
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Clears the collection but without changing its capacity (all inserted elements: keys and values will be removed).
|
/// Clears the collection but without changing its capacity (all inserted elements: keys and values will be removed).
|
||||||
/// </summary>
|
/// </summary>
|
||||||
@@ -571,7 +564,6 @@ public:
|
|||||||
}
|
}
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Add pair element to the collection.
|
/// Add pair element to the collection.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
@@ -700,7 +692,6 @@ public:
|
|||||||
}
|
}
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Finds the element with given key in the collection.
|
/// Finds the element with given key in the collection.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
@@ -775,7 +766,6 @@ public:
|
|||||||
}
|
}
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Clones other collection into this.
|
/// Clones other collection into this.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
@@ -813,7 +803,6 @@ public:
|
|||||||
}
|
}
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
|
||||||
Iterator Begin() const
|
Iterator Begin() const
|
||||||
{
|
{
|
||||||
Iterator i(*this, -1);
|
Iterator i(*this, -1);
|
||||||
@@ -851,7 +840,6 @@ public:
|
|||||||
}
|
}
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// The result container of the dictionary item lookup searching.
|
/// The result container of the dictionary item lookup searching.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
@@ -898,7 +886,7 @@ protected:
|
|||||||
if (insertPos == -1)
|
if (insertPos == -1)
|
||||||
insertPos = bucketIndex;
|
insertPos = bucketIndex;
|
||||||
}
|
}
|
||||||
// Occupied bucket by target key
|
// Occupied bucket by target key
|
||||||
else if (bucket.Key == key)
|
else if (bucket.Key == key)
|
||||||
{
|
{
|
||||||
// Found key
|
// Found key
|
||||||
|
|||||||
@@ -17,7 +17,6 @@ API_CLASS(InBuild) class HashSet
|
|||||||
{
|
{
|
||||||
friend HashSet;
|
friend HashSet;
|
||||||
public:
|
public:
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Describes single portion of space for the item in a hash map.
|
/// Describes single portion of space for the item in a hash map.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
@@ -31,7 +30,7 @@ public:
|
|||||||
Deleted,
|
Deleted,
|
||||||
Occupied,
|
Occupied,
|
||||||
};
|
};
|
||||||
|
|
||||||
/// <summary>The item.</summary>
|
/// <summary>The item.</summary>
|
||||||
T Item;
|
T Item;
|
||||||
|
|
||||||
@@ -78,18 +77,16 @@ public:
|
|||||||
return _state != Occupied;
|
return _state != Occupied;
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
typedef typename AllocationType::template Data<Bucket> AllocationData;
|
typedef typename AllocationType::template Data<Bucket> AllocationData;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
|
||||||
int32 _elementsCount = 0;
|
int32 _elementsCount = 0;
|
||||||
int32 _deletedCount = 0;
|
int32 _deletedCount = 0;
|
||||||
int32 _size = 0;
|
int32 _size = 0;
|
||||||
AllocationData _allocation;
|
AllocationData _allocation;
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Initializes a new instance of the <see cref="HashSet"/> class.
|
/// Initializes a new instance of the <see cref="HashSet"/> class.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
@@ -176,7 +173,6 @@ public:
|
|||||||
}
|
}
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Gets the amount of the elements in the collection.
|
/// Gets the amount of the elements in the collection.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
@@ -210,7 +206,6 @@ public:
|
|||||||
}
|
}
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// The hash set collection iterator.
|
/// The hash set collection iterator.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
@@ -234,7 +229,6 @@ public:
|
|||||||
}
|
}
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
|
||||||
Iterator(const Iterator& i)
|
Iterator(const Iterator& i)
|
||||||
: _collection(i._collection)
|
: _collection(i._collection)
|
||||||
, _index(i._index)
|
, _index(i._index)
|
||||||
@@ -248,7 +242,6 @@ public:
|
|||||||
}
|
}
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
|
||||||
FORCE_INLINE bool IsEnd() const
|
FORCE_INLINE bool IsEnd() const
|
||||||
{
|
{
|
||||||
return _index == _collection.Capacity();
|
return _index == _collection.Capacity();
|
||||||
@@ -332,7 +325,6 @@ public:
|
|||||||
};
|
};
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Removes all elements from the collection.
|
/// Removes all elements from the collection.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
@@ -431,7 +423,6 @@ public:
|
|||||||
}
|
}
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Add element to the collection.
|
/// Add element to the collection.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
@@ -513,7 +504,6 @@ public:
|
|||||||
}
|
}
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Find element with given item in the collection
|
/// Find element with given item in the collection
|
||||||
/// </summary>
|
/// </summary>
|
||||||
@@ -545,7 +535,6 @@ public:
|
|||||||
}
|
}
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Clones other collection into this
|
/// Clones other collection into this
|
||||||
/// </summary>
|
/// </summary>
|
||||||
@@ -561,7 +550,6 @@ public:
|
|||||||
}
|
}
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
|
||||||
Iterator Begin() const
|
Iterator Begin() const
|
||||||
{
|
{
|
||||||
Iterator i(*this, -1);
|
Iterator i(*this, -1);
|
||||||
@@ -599,7 +587,6 @@ public:
|
|||||||
}
|
}
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// The result container of the set item lookup searching.
|
/// The result container of the set item lookup searching.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
@@ -646,7 +633,7 @@ protected:
|
|||||||
if (insertPos == -1)
|
if (insertPos == -1)
|
||||||
insertPos = bucketIndex;
|
insertPos = bucketIndex;
|
||||||
}
|
}
|
||||||
// Occupied bucket by target item
|
// Occupied bucket by target item
|
||||||
else if (bucket.Item == item)
|
else if (bucket.Item == item)
|
||||||
{
|
{
|
||||||
// Found item
|
// Found item
|
||||||
|
|||||||
@@ -13,92 +13,89 @@ template<typename T, typename AllocationType = HeapAllocation>
|
|||||||
class RingBuffer
|
class RingBuffer
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
|
typedef T ItemType;
|
||||||
typedef T ItemType;
|
typedef typename AllocationType::template Data<T> AllocationData;
|
||||||
typedef typename AllocationType::template Data<T> AllocationData;
|
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
int32 _front = 0, _back = 0, _count = 0, _capacity = 0;
|
||||||
int32 _front = 0, _back = 0, _count = 0, _capacity = 0;
|
AllocationData _allocation;
|
||||||
AllocationData _allocation;
|
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
~RingBuffer()
|
||||||
|
{
|
||||||
|
Memory::DestructItems(Get() + Math::Min(_front, _back), _count);
|
||||||
|
}
|
||||||
|
|
||||||
~RingBuffer()
|
FORCE_INLINE T* Get()
|
||||||
{
|
{
|
||||||
Memory::DestructItems(Get() + Math::Min(_front, _back), _count);
|
return _allocation.Get();
|
||||||
}
|
}
|
||||||
|
|
||||||
FORCE_INLINE T* Get()
|
FORCE_INLINE int32 Count() const
|
||||||
{
|
{
|
||||||
return _allocation.Get();
|
return _count;
|
||||||
}
|
}
|
||||||
|
|
||||||
FORCE_INLINE int32 Count() const
|
FORCE_INLINE int32 Capacity() const
|
||||||
{
|
{
|
||||||
return _count;
|
return _capacity;
|
||||||
}
|
}
|
||||||
|
|
||||||
FORCE_INLINE int32 Capacity() const
|
void PushBack(const T& data)
|
||||||
{
|
{
|
||||||
return _capacity;
|
if (_capacity == 0 || _capacity == _count)
|
||||||
}
|
{
|
||||||
|
const int32 capacity = _allocation.CalculateCapacityGrow(_capacity, _count + 1);
|
||||||
|
AllocationData alloc;
|
||||||
|
alloc.Allocate(capacity);
|
||||||
|
const int32 frontCount = Math::Min(_capacity - _front, _count);
|
||||||
|
Memory::MoveItems(alloc.Get(), _allocation.Get() + _front, frontCount);
|
||||||
|
Memory::DestructItems(_allocation.Get() + _front, frontCount);
|
||||||
|
const int32 backCount = _count - frontCount;
|
||||||
|
Memory::MoveItems(alloc.Get() + frontCount, _allocation.Get(), backCount);
|
||||||
|
Memory::DestructItems(_allocation.Get(), backCount);
|
||||||
|
_allocation.Swap(alloc);
|
||||||
|
_front = 0;
|
||||||
|
_back = _count;
|
||||||
|
_capacity = capacity;
|
||||||
|
}
|
||||||
|
Memory::ConstructItems(_allocation.Get() + _back, &data, 1);
|
||||||
|
_back = (_back + 1) % _capacity;
|
||||||
|
_count++;
|
||||||
|
}
|
||||||
|
|
||||||
void PushBack(const T& data)
|
FORCE_INLINE T& PeekFront()
|
||||||
{
|
{
|
||||||
if (_capacity == 0 || _capacity == _count)
|
return _allocation.Get()[_front];
|
||||||
{
|
}
|
||||||
const int32 capacity = _allocation.CalculateCapacityGrow(_capacity, _count + 1);
|
|
||||||
AllocationData alloc;
|
|
||||||
alloc.Allocate(capacity);
|
|
||||||
const int32 frontCount = Math::Min(_capacity - _front, _count);
|
|
||||||
Memory::MoveItems(alloc.Get(), _allocation.Get() + _front, frontCount);
|
|
||||||
Memory::DestructItems(_allocation.Get() + _front, frontCount);
|
|
||||||
const int32 backCount = _count - frontCount;
|
|
||||||
Memory::MoveItems(alloc.Get() + frontCount, _allocation.Get(), backCount);
|
|
||||||
Memory::DestructItems(_allocation.Get(), backCount);
|
|
||||||
_allocation.Swap(alloc);
|
|
||||||
_front = 0;
|
|
||||||
_back = _count;
|
|
||||||
_capacity = capacity;
|
|
||||||
}
|
|
||||||
Memory::ConstructItems(_allocation.Get() + _back, &data, 1);
|
|
||||||
_back = (_back + 1) % _capacity;
|
|
||||||
_count++;
|
|
||||||
}
|
|
||||||
|
|
||||||
FORCE_INLINE T& PeekFront()
|
FORCE_INLINE const T& PeekFront() const
|
||||||
{
|
{
|
||||||
return _allocation.Get()[_front];
|
return _allocation.Get()[_front];
|
||||||
}
|
}
|
||||||
|
|
||||||
FORCE_INLINE const T& PeekFront() const
|
|
||||||
{
|
|
||||||
return _allocation.Get()[_front];
|
|
||||||
}
|
|
||||||
|
|
||||||
FORCE_INLINE T& operator[](int32 index)
|
FORCE_INLINE T& operator[](int32 index)
|
||||||
{
|
{
|
||||||
ASSERT(index >= 0 && index < _count);
|
ASSERT(index >= 0 && index < _count);
|
||||||
return _allocation.Get()[(_front + index) % _capacity];
|
return _allocation.Get()[(_front + index) % _capacity];
|
||||||
}
|
}
|
||||||
|
|
||||||
FORCE_INLINE const T& operator[](int32 index) const
|
FORCE_INLINE const T& operator[](int32 index) const
|
||||||
{
|
{
|
||||||
ASSERT(index >= 0 && index < _count);
|
ASSERT(index >= 0 && index < _count);
|
||||||
return _allocation.Get()[(_front + index) % _capacity];
|
return _allocation.Get()[(_front + index) % _capacity];
|
||||||
}
|
}
|
||||||
|
|
||||||
void PopFront()
|
void PopFront()
|
||||||
{
|
{
|
||||||
Memory::DestructItems(_allocation.Get() + _front, 1);
|
Memory::DestructItems(_allocation.Get() + _front, 1);
|
||||||
_front = (_front + 1) % _capacity;
|
_front = (_front + 1) % _capacity;
|
||||||
_count--;
|
_count--;
|
||||||
}
|
}
|
||||||
|
|
||||||
void Clear()
|
void Clear()
|
||||||
{
|
{
|
||||||
Memory::DestructItems(Get() + Math::Min(_front, _back), _count);
|
Memory::DestructItems(Get() + Math::Min(_front, _back), _count);
|
||||||
_front = _back = _count = 0;
|
_front = _back = _count = 0;
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -12,12 +12,10 @@ template<typename T, int32 Size>
|
|||||||
class SamplesBuffer
|
class SamplesBuffer
|
||||||
{
|
{
|
||||||
protected:
|
protected:
|
||||||
|
|
||||||
int32 _count = 0;
|
int32 _count = 0;
|
||||||
T _data[Size];
|
T _data[Size];
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Gets amount of elements in the collection.
|
/// Gets amount of elements in the collection.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
@@ -110,7 +108,6 @@ public:
|
|||||||
}
|
}
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Adds the specified value to the buffer.
|
/// Adds the specified value to the buffer.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
@@ -146,7 +143,6 @@ public:
|
|||||||
}
|
}
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Gets the minimum value in the buffer.
|
/// Gets the minimum value in the buffer.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
|||||||
@@ -11,14 +11,12 @@
|
|||||||
class FLAXENGINE_API Sorting
|
class FLAXENGINE_API Sorting
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Helper collection used by the sorting algorithms. Implements stack using single linear allocation with variable capacity.
|
/// Helper collection used by the sorting algorithms. Implements stack using single linear allocation with variable capacity.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
class FLAXENGINE_API SortingStack
|
class FLAXENGINE_API SortingStack
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
|
|
||||||
static SortingStack& Get();
|
static SortingStack& Get();
|
||||||
|
|
||||||
int32 Count = 0;
|
int32 Count = 0;
|
||||||
@@ -47,7 +45,6 @@ public:
|
|||||||
};
|
};
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Sorts the linear data array using Quick Sort algorithm (non recursive version, uses temporary stack collection).
|
/// Sorts the linear data array using Quick Sort algorithm (non recursive version, uses temporary stack collection).
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
|||||||
@@ -51,7 +51,6 @@ class ScriptingObject;
|
|||||||
struct FLAXENGINE_API CommonValue
|
struct FLAXENGINE_API CommonValue
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Type
|
/// Type
|
||||||
/// </summary>
|
/// </summary>
|
||||||
@@ -86,7 +85,6 @@ public:
|
|||||||
};
|
};
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
|
||||||
// 0.0f (floating-point value type)
|
// 0.0f (floating-point value type)
|
||||||
static const CommonValue Zero;
|
static const CommonValue Zero;
|
||||||
|
|
||||||
@@ -103,7 +101,6 @@ public:
|
|||||||
static const CommonValue True;
|
static const CommonValue True;
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Default constructor (bool)
|
/// Default constructor (bool)
|
||||||
/// </summary>
|
/// </summary>
|
||||||
@@ -365,7 +362,6 @@ public:
|
|||||||
}
|
}
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Assignment operator
|
/// Assignment operator
|
||||||
/// </summary>
|
/// </summary>
|
||||||
@@ -426,7 +422,6 @@ public:
|
|||||||
}
|
}
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Gets value as boolean (if can convert it)
|
/// Gets value as boolean (if can convert it)
|
||||||
/// </summary>
|
/// </summary>
|
||||||
@@ -742,7 +737,6 @@ public:
|
|||||||
}
|
}
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Set new value and change type to Bool
|
/// Set new value and change type to Bool
|
||||||
/// </summary>
|
/// </summary>
|
||||||
@@ -944,7 +938,6 @@ public:
|
|||||||
}
|
}
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Change common value type
|
/// Change common value type
|
||||||
/// </summary>
|
/// </summary>
|
||||||
@@ -975,7 +968,6 @@ public:
|
|||||||
}
|
}
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Casts value from its type to another
|
/// Casts value from its type to another
|
||||||
/// </summary>
|
/// </summary>
|
||||||
@@ -1027,7 +1019,6 @@ public:
|
|||||||
}
|
}
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
|
||||||
friend bool operator==(const CommonValue& a, const CommonValue& b)
|
friend bool operator==(const CommonValue& a, const CommonValue& b)
|
||||||
{
|
{
|
||||||
ASSERT(a.Type == b.Type);
|
ASSERT(a.Type == b.Type);
|
||||||
@@ -1097,20 +1088,20 @@ public:
|
|||||||
return a.AsVector3 > b.AsVector3;
|
return a.AsVector3 > b.AsVector3;
|
||||||
case CommonType::Vector4:
|
case CommonType::Vector4:
|
||||||
return a.AsVector4 > b.AsVector4;
|
return a.AsVector4 > b.AsVector4;
|
||||||
//case CommonType::Color: return a.AsColor > b.AsColor;
|
//case CommonType::Color: return a.AsColor > b.AsColor;
|
||||||
//case CommonType::Guid: return a.AsGuid > b.AsGuid;
|
//case CommonType::Guid: return a.AsGuid > b.AsGuid;
|
||||||
case CommonType::String:
|
case CommonType::String:
|
||||||
return StringUtils::Compare(a.AsString, b.AsString) > 0;
|
return StringUtils::Compare(a.AsString, b.AsString) > 0;
|
||||||
//case CommonType::Box: return a.AsBox > b.AsBox;
|
//case CommonType::Box: return a.AsBox > b.AsBox;
|
||||||
//case CommonType::Rotation: return a.AsRotation > b.AsRotation;
|
//case CommonType::Rotation: return a.AsRotation > b.AsRotation;
|
||||||
//case CommonType::Transform: return a.AsTransform > b.AsTransform;
|
//case CommonType::Transform: return a.AsTransform > b.AsTransform;
|
||||||
//case CommonType::Sphere: return a.AsSphere > b.AsSphere;
|
//case CommonType::Sphere: return a.AsSphere > b.AsSphere;
|
||||||
//case CommonType::Rectangle: return a.AsRectangle > b.AsRectangle;
|
//case CommonType::Rectangle: return a.AsRectangle > b.AsRectangle;
|
||||||
//case CommonType::Ray: return a.AsRay > b.AsRay;
|
//case CommonType::Ray: return a.AsRay > b.AsRay;
|
||||||
case CommonType::Pointer:
|
case CommonType::Pointer:
|
||||||
case CommonType::Object:
|
case CommonType::Object:
|
||||||
return a.AsPointer > b.AsPointer;
|
return a.AsPointer > b.AsPointer;
|
||||||
//case CommonType::Matrix: return a.AsMatrix > b.AsMatrix;
|
//case CommonType::Matrix: return a.AsMatrix > b.AsMatrix;
|
||||||
case CommonType::Blob:
|
case CommonType::Blob:
|
||||||
return a.AsBlob.Length > b.AsBlob.Length;
|
return a.AsBlob.Length > b.AsBlob.Length;
|
||||||
default: CRASH;
|
default: CRASH;
|
||||||
@@ -1134,7 +1125,6 @@ public:
|
|||||||
}
|
}
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
|
||||||
static bool NearEqual(const CommonValue& a, const CommonValue& b, float epsilon);
|
static bool NearEqual(const CommonValue& a, const CommonValue& b, float epsilon);
|
||||||
|
|
||||||
static CommonValue Lerp(const CommonValue& a, const CommonValue& b, float alpha);
|
static CommonValue Lerp(const CommonValue& a, const CommonValue& b, float alpha);
|
||||||
@@ -1143,7 +1133,6 @@ public:
|
|||||||
Guid GetObjectId() const;
|
Guid GetObjectId() const;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
|
||||||
void OnObjectDeleted(ScriptingObject* obj)
|
void OnObjectDeleted(ScriptingObject* obj)
|
||||||
{
|
{
|
||||||
AsObject = nullptr;
|
AsObject = nullptr;
|
||||||
|
|||||||
@@ -15,15 +15,12 @@ template<typename T>
|
|||||||
class DataContainer : public Span<T>
|
class DataContainer : public Span<T>
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
|
|
||||||
typedef Span<T> Base;
|
typedef Span<T> Base;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
|
||||||
bool _isAllocated;
|
bool _isAllocated;
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Initializes a new instance of the <see cref="DataContainer"/> class.
|
/// Initializes a new instance of the <see cref="DataContainer"/> class.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
@@ -129,7 +126,6 @@ public:
|
|||||||
}
|
}
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Returns true if data is allocated by container itself, otherwise it's just linked.
|
/// Returns true if data is allocated by container itself, otherwise it's just linked.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
@@ -339,7 +335,6 @@ public:
|
|||||||
}
|
}
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
|
||||||
template<typename ReadStream>
|
template<typename ReadStream>
|
||||||
void Read(ReadStream* stream, int32 length)
|
void Read(ReadStream* stream, int32 length)
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -23,14 +23,12 @@ DECLARE_ENUM_EX_12(MonthOfYear, int32, 1, January, February, March, April, May,
|
|||||||
API_STRUCT(InBuild, Namespace="System") struct FLAXENGINE_API DateTime
|
API_STRUCT(InBuild, Namespace="System") struct FLAXENGINE_API DateTime
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Ticks in 100 nanoseconds resolution since January 1, 0001 A.D.
|
/// Ticks in 100 nanoseconds resolution since January 1, 0001 A.D.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
int64 Ticks;
|
int64 Ticks;
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Empty constructor.
|
/// Empty constructor.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
@@ -60,7 +58,6 @@ public:
|
|||||||
DateTime(int32 year, int32 month, int32 day, int32 hour = 0, int32 minute = 0, int32 second = 0, int32 millisecond = 0);
|
DateTime(int32 year, int32 month, int32 day, int32 hour = 0, int32 minute = 0, int32 second = 0, int32 millisecond = 0);
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Gets the string.
|
/// Gets the string.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
@@ -72,7 +69,6 @@ public:
|
|||||||
String ToFileNameString() const;
|
String ToFileNameString() const;
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
|
||||||
DateTime operator+(const TimeSpan& other) const;
|
DateTime operator+(const TimeSpan& other) const;
|
||||||
DateTime& operator+=(const TimeSpan& other);
|
DateTime& operator+=(const TimeSpan& other);
|
||||||
TimeSpan operator-(const DateTime& other) const;
|
TimeSpan operator-(const DateTime& other) const;
|
||||||
@@ -110,7 +106,6 @@ public:
|
|||||||
}
|
}
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Gets the date part of this date. The time part is truncated and becomes 00:00:00.000.
|
/// Gets the date part of this date. The time part is truncated and becomes 00:00:00.000.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
@@ -210,7 +205,6 @@ public:
|
|||||||
int32 ToUnixTimestamp() const;
|
int32 ToUnixTimestamp() const;
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Gets the number of days in the year and month.
|
/// Gets the number of days in the year and month.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
|||||||
@@ -63,7 +63,7 @@ FORCE_INLINE void GuidToString(const CharType* cachedGuidDigits, CharType* buffe
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case Guid::FormatType::B:
|
case Guid::FormatType::B:
|
||||||
// TODO: impl GuidToString for FormatType::B:
|
// TODO: impl GuidToString for FormatType::B:
|
||||||
case Guid::FormatType::P:
|
case Guid::FormatType::P:
|
||||||
// TODO: impl GuidToString for FormatType::P:
|
// TODO: impl GuidToString for FormatType::P:
|
||||||
default:
|
default:
|
||||||
@@ -89,7 +89,7 @@ FORCE_INLINE bool GuidParse(const StringViewType& text, Guid& value)
|
|||||||
{
|
{
|
||||||
switch (text.Length())
|
switch (text.Length())
|
||||||
{
|
{
|
||||||
// FormatType::N
|
// FormatType::N
|
||||||
case 32:
|
case 32:
|
||||||
{
|
{
|
||||||
return
|
return
|
||||||
@@ -98,7 +98,7 @@ FORCE_INLINE bool GuidParse(const StringViewType& text, Guid& value)
|
|||||||
StringUtils::ParseHex(*text + 16, 8, &value.C) ||
|
StringUtils::ParseHex(*text + 16, 8, &value.C) ||
|
||||||
StringUtils::ParseHex(*text + 24, 8, &value.D);
|
StringUtils::ParseHex(*text + 24, 8, &value.D);
|
||||||
}
|
}
|
||||||
// FormatType::D
|
// FormatType::D
|
||||||
case 36:
|
case 36:
|
||||||
{
|
{
|
||||||
StringType b = StringType(text.Substring(9, 4)) + text.Substring(14, 4);
|
StringType b = StringType(text.Substring(9, 4)) + text.Substring(14, 4);
|
||||||
@@ -109,8 +109,8 @@ FORCE_INLINE bool GuidParse(const StringViewType& text, Guid& value)
|
|||||||
StringUtils::ParseHex(*c, &value.C) ||
|
StringUtils::ParseHex(*c, &value.C) ||
|
||||||
StringUtils::ParseHex(*text + 28, 8, &value.D);
|
StringUtils::ParseHex(*text + 28, 8, &value.D);
|
||||||
}
|
}
|
||||||
// FormatType::B
|
// FormatType::B
|
||||||
// FormatType::P
|
// FormatType::P
|
||||||
case 38:
|
case 38:
|
||||||
{
|
{
|
||||||
StringType b = StringType(text.Substring(10, 4)) + text.Substring(15, 4);
|
StringType b = StringType(text.Substring(10, 4)) + text.Substring(15, 4);
|
||||||
|
|||||||
@@ -15,7 +15,6 @@ class String;
|
|||||||
API_STRUCT(InBuild, Namespace="System") struct FLAXENGINE_API Guid
|
API_STRUCT(InBuild, Namespace="System") struct FLAXENGINE_API Guid
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Accepted format specifiers for the format parameter
|
/// Accepted format specifiers for the format parameter
|
||||||
/// </summary>
|
/// </summary>
|
||||||
@@ -39,7 +38,6 @@ public:
|
|||||||
};
|
};
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
|
||||||
union
|
union
|
||||||
{
|
{
|
||||||
struct
|
struct
|
||||||
@@ -65,12 +63,10 @@ public:
|
|||||||
};
|
};
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
|
||||||
// Empty Guid (considered as invalid ID)
|
// Empty Guid (considered as invalid ID)
|
||||||
static Guid Empty;
|
static Guid Empty;
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Empty constructor.
|
/// Empty constructor.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
@@ -92,7 +88,6 @@ public:
|
|||||||
}
|
}
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
|
||||||
// Compares two Guids for equality
|
// Compares two Guids for equality
|
||||||
// @param left The first Guid to compare
|
// @param left The first Guid to compare
|
||||||
// @param right The second Guid to compare
|
// @param right The second Guid to compare
|
||||||
@@ -152,14 +147,12 @@ public:
|
|||||||
}
|
}
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
|
||||||
String ToString() const;
|
String ToString() const;
|
||||||
String ToString(FormatType format) const;
|
String ToString(FormatType format) const;
|
||||||
void ToString(char* buffer, FormatType format) const;
|
void ToString(char* buffer, FormatType format) const;
|
||||||
void ToString(Char* buffer, FormatType format) const;
|
void ToString(Char* buffer, FormatType format) const;
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Try to parse Guid from string
|
/// Try to parse Guid from string
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
|||||||
@@ -10,7 +10,7 @@
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
API_STRUCT() struct FLAXENGINE_API LayersMask
|
API_STRUCT() struct FLAXENGINE_API LayersMask
|
||||||
{
|
{
|
||||||
DECLARE_SCRIPTING_TYPE_MINIMAL(LayersMask);
|
DECLARE_SCRIPTING_TYPE_MINIMAL(LayersMask);
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// The layers selection mask.
|
/// The layers selection mask.
|
||||||
@@ -18,7 +18,6 @@ DECLARE_SCRIPTING_TYPE_MINIMAL(LayersMask);
|
|||||||
API_FIELD() uint32 Mask = MAX_uint32;
|
API_FIELD() uint32 Mask = MAX_uint32;
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
|
||||||
FORCE_INLINE LayersMask()
|
FORCE_INLINE LayersMask()
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -11,12 +11,10 @@ template<typename T>
|
|||||||
struct NullableBase
|
struct NullableBase
|
||||||
{
|
{
|
||||||
protected:
|
protected:
|
||||||
|
|
||||||
bool _hasValue;
|
bool _hasValue;
|
||||||
T _value;
|
T _value;
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Initializes a new instance of the <see cref="NullableBase{T}"/> struct.
|
/// Initializes a new instance of the <see cref="NullableBase{T}"/> struct.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
@@ -46,7 +44,6 @@ public:
|
|||||||
}
|
}
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Gets a value indicating whether the current NullableBase{T} object has a valid value of its underlying type.
|
/// Gets a value indicating whether the current NullableBase{T} object has a valid value of its underlying type.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
@@ -95,7 +92,6 @@ public:
|
|||||||
}
|
}
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Indicates whether the current NullableBase{T} object is equal to a specified object.
|
/// Indicates whether the current NullableBase{T} object is equal to a specified object.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
@@ -129,7 +125,6 @@ template<typename T>
|
|||||||
struct Nullable : NullableBase<T>
|
struct Nullable : NullableBase<T>
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Initializes a new instance of the <see cref="Nullable{T}"/> struct.
|
/// Initializes a new instance of the <see cref="Nullable{T}"/> struct.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
@@ -164,7 +159,6 @@ template<>
|
|||||||
struct Nullable<bool> : NullableBase<bool>
|
struct Nullable<bool> : NullableBase<bool>
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Initializes a new instance of the <see cref="Nullable{T}"/> struct.
|
/// Initializes a new instance of the <see cref="Nullable{T}"/> struct.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
@@ -192,7 +186,6 @@ public:
|
|||||||
}
|
}
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Gets a value indicating whether the current Nullable{T} object has a valid value and it's set to true.
|
/// Gets a value indicating whether the current Nullable{T} object has a valid value and it's set to true.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
|||||||
@@ -12,7 +12,6 @@ template<typename T, typename U>
|
|||||||
class Pair
|
class Pair
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// The first element.
|
/// The first element.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
@@ -24,7 +23,6 @@ public:
|
|||||||
U Second;
|
U Second;
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Initializes a new instance of the <see cref="Pair"/> class.
|
/// Initializes a new instance of the <see cref="Pair"/> class.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
@@ -64,7 +62,6 @@ public:
|
|||||||
}
|
}
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
|
||||||
Pair& operator=(const Pair& other)
|
Pair& operator=(const Pair& other)
|
||||||
{
|
{
|
||||||
if (this == &other)
|
if (this == &other)
|
||||||
|
|||||||
@@ -11,12 +11,10 @@ template<typename T>
|
|||||||
class Span
|
class Span
|
||||||
{
|
{
|
||||||
protected:
|
protected:
|
||||||
|
|
||||||
T* _data;
|
T* _data;
|
||||||
int32 _length;
|
int32 _length;
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Initializes a new instance of the <see cref="Span"/> class.
|
/// Initializes a new instance of the <see cref="Span"/> class.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
@@ -38,7 +36,6 @@ public:
|
|||||||
}
|
}
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Returns true if data is valid.
|
/// Returns true if data is valid.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
@@ -95,7 +92,6 @@ public:
|
|||||||
}
|
}
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Gets or sets the element by index
|
/// Gets or sets the element by index
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
|||||||
@@ -13,12 +13,10 @@ template<typename T>
|
|||||||
class StringBase
|
class StringBase
|
||||||
{
|
{
|
||||||
protected:
|
protected:
|
||||||
|
|
||||||
T* _data = nullptr;
|
T* _data = nullptr;
|
||||||
int32 _length = 0;
|
int32 _length = 0;
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Finalizes an instance of the <see cref="StringBase"/> class.
|
/// Finalizes an instance of the <see cref="StringBase"/> class.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
@@ -28,7 +26,6 @@ public:
|
|||||||
}
|
}
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Clears this instance. Frees the memory and sets the string to empty.
|
/// Clears this instance. Frees the memory and sets the string to empty.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
@@ -40,7 +37,6 @@ public:
|
|||||||
}
|
}
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Gets the character at the specific index.
|
/// Gets the character at the specific index.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
@@ -64,7 +60,6 @@ public:
|
|||||||
}
|
}
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Lexicographically tests how this string compares to the other given string.
|
/// Lexicographically tests how this string compares to the other given string.
|
||||||
/// In case sensitive mode 'A' is less than 'a'.
|
/// In case sensitive mode 'A' is less than 'a'.
|
||||||
@@ -80,7 +75,6 @@ public:
|
|||||||
}
|
}
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Returns true if string is empty.
|
/// Returns true if string is empty.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
@@ -154,7 +148,6 @@ public:
|
|||||||
}
|
}
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Checks whether this string contains the specified substring.
|
/// Checks whether this string contains the specified substring.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
@@ -353,7 +346,6 @@ public:
|
|||||||
}
|
}
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
|
||||||
bool StartsWith(T c, StringSearchCase searchCase = StringSearchCase::CaseSensitive) const
|
bool StartsWith(T c, StringSearchCase searchCase = StringSearchCase::CaseSensitive) const
|
||||||
{
|
{
|
||||||
const int32 length = Length();
|
const int32 length = Length();
|
||||||
@@ -551,14 +543,12 @@ public:
|
|||||||
API_CLASS(InBuild) class FLAXENGINE_API String : public StringBase<Char>
|
API_CLASS(InBuild) class FLAXENGINE_API String : public StringBase<Char>
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Instance of the empty string.
|
/// Instance of the empty string.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
static String Empty;
|
static String Empty;
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Initializes a new instance of the <see cref="String"/> class.
|
/// Initializes a new instance of the <see cref="String"/> class.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
@@ -646,7 +636,6 @@ public:
|
|||||||
explicit String(const StringAnsiView& str);
|
explicit String(const StringAnsiView& str);
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Sets an array of characters to the string.
|
/// Sets an array of characters to the string.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
@@ -775,7 +764,6 @@ public:
|
|||||||
}
|
}
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Sets the text value.
|
/// Sets the text value.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
@@ -848,7 +836,6 @@ public:
|
|||||||
}
|
}
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
|
||||||
// @formatter:off
|
// @formatter:off
|
||||||
FORCE_INLINE friend String operator+(const String& a, const String& b)
|
FORCE_INLINE friend String operator+(const String& a, const String& b)
|
||||||
{
|
{
|
||||||
@@ -941,7 +928,6 @@ public:
|
|||||||
// @formatter:on
|
// @formatter:on
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Checks if string contains only ANSI characters.
|
/// Checks if string contains only ANSI characters.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
@@ -949,7 +935,6 @@ public:
|
|||||||
bool IsANSI() const;
|
bool IsANSI() const;
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
|
||||||
using StringBase::StartsWith;
|
using StringBase::StartsWith;
|
||||||
bool StartsWith(const StringView& prefix, StringSearchCase searchCase = StringSearchCase::CaseSensitive) const;
|
bool StartsWith(const StringView& prefix, StringSearchCase searchCase = StringSearchCase::CaseSensitive) const;
|
||||||
|
|
||||||
@@ -1060,7 +1045,6 @@ public:
|
|||||||
String TrimTrailing() const;
|
String TrimTrailing() const;
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Formats the message and gets it as a string.
|
/// Formats the message and gets it as a string.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
@@ -1077,7 +1061,6 @@ public:
|
|||||||
}
|
}
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Concatenates this path with given path ensuring the '/' character is used between them.
|
/// Concatenates this path with given path ensuring the '/' character is used between them.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
@@ -1167,7 +1150,6 @@ public:
|
|||||||
}
|
}
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
|
||||||
String ToString() const
|
String ToString() const
|
||||||
{
|
{
|
||||||
return *this;
|
return *this;
|
||||||
@@ -1176,7 +1158,6 @@ public:
|
|||||||
StringAnsi ToStringAnsi() const;
|
StringAnsi ToStringAnsi() const;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
|
||||||
template<typename T1, typename T2>
|
template<typename T1, typename T2>
|
||||||
static String ConcatStrings(T1 left, T2 right)
|
static String ConcatStrings(T1 left, T2 right)
|
||||||
{
|
{
|
||||||
@@ -1267,14 +1248,12 @@ namespace fmt
|
|||||||
API_CLASS(InBuild) class FLAXENGINE_API StringAnsi : public StringBase<char>
|
API_CLASS(InBuild) class FLAXENGINE_API StringAnsi : public StringBase<char>
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Instance of the empty string.
|
/// Instance of the empty string.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
static StringAnsi Empty;
|
static StringAnsi Empty;
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Initializes a new instance of the <see cref="StringAnsi"/> class.
|
/// Initializes a new instance of the <see cref="StringAnsi"/> class.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
@@ -1361,7 +1340,6 @@ public:
|
|||||||
explicit StringAnsi(const StringAnsiView& str);
|
explicit StringAnsi(const StringAnsiView& str);
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Sets an array of characters to the string.
|
/// Sets an array of characters to the string.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
@@ -1483,7 +1461,6 @@ public:
|
|||||||
}
|
}
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Sets the text value.
|
/// Sets the text value.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
@@ -1556,7 +1533,6 @@ public:
|
|||||||
}
|
}
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
|
||||||
// @formatter:off
|
// @formatter:off
|
||||||
FORCE_INLINE friend StringAnsi operator+(const StringAnsi& a, const StringAnsi& b)
|
FORCE_INLINE friend StringAnsi operator+(const StringAnsi& a, const StringAnsi& b)
|
||||||
{
|
{
|
||||||
@@ -1641,7 +1617,6 @@ public:
|
|||||||
// @formatter:on
|
// @formatter:on
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
|
||||||
using StringBase::StartsWith;
|
using StringBase::StartsWith;
|
||||||
bool StartsWith(const StringAnsiView& prefix, StringSearchCase searchCase = StringSearchCase::CaseSensitive) const;
|
bool StartsWith(const StringAnsiView& prefix, StringSearchCase searchCase = StringSearchCase::CaseSensitive) const;
|
||||||
|
|
||||||
@@ -1727,7 +1702,6 @@ public:
|
|||||||
void Split(char c, Array<StringAnsi, HeapAllocation>& results) const;
|
void Split(char c, Array<StringAnsi, HeapAllocation>& results) const;
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Formats the message and gets it as a string.
|
/// Formats the message and gets it as a string.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
@@ -1744,7 +1718,6 @@ public:
|
|||||||
}
|
}
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
|
||||||
String ToString() const
|
String ToString() const
|
||||||
{
|
{
|
||||||
return String(Get(), Length());
|
return String(Get(), Length());
|
||||||
@@ -1756,7 +1729,6 @@ public:
|
|||||||
}
|
}
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
|
||||||
template<typename T1, typename T2>
|
template<typename T1, typename T2>
|
||||||
static StringAnsi ConcatStrings(T1 left, T2 right)
|
static StringAnsi ConcatStrings(T1 left, T2 right)
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -11,14 +11,12 @@
|
|||||||
class FLAXENGINE_API StringBuilder
|
class FLAXENGINE_API StringBuilder
|
||||||
{
|
{
|
||||||
private:
|
private:
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Array with characters of the string (it's not null-terminated)
|
/// Array with characters of the string (it's not null-terminated)
|
||||||
/// </summary>
|
/// </summary>
|
||||||
Array<Char> _data;
|
Array<Char> _data;
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Init
|
/// Init
|
||||||
/// </summary>
|
/// </summary>
|
||||||
@@ -36,7 +34,6 @@ public:
|
|||||||
}
|
}
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Gets capacity
|
/// Gets capacity
|
||||||
/// </summary>
|
/// </summary>
|
||||||
@@ -82,7 +79,6 @@ public:
|
|||||||
}
|
}
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
|
||||||
// Append single character to the string
|
// Append single character to the string
|
||||||
// @param c Character to append
|
// @param c Character to append
|
||||||
// @return Current String Builder instance
|
// @return Current String Builder instance
|
||||||
@@ -175,7 +171,6 @@ public:
|
|||||||
}
|
}
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
|
||||||
StringBuilder& AppendLine()
|
StringBuilder& AppendLine()
|
||||||
{
|
{
|
||||||
Append(TEXT(PLATFORM_LINE_TERMINATOR));
|
Append(TEXT(PLATFORM_LINE_TERMINATOR));
|
||||||
@@ -224,7 +219,6 @@ public:
|
|||||||
}
|
}
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
|
||||||
// Retrieves substring created from characters starting from startIndex
|
// Retrieves substring created from characters starting from startIndex
|
||||||
// @param startIndex Index of the first character to subtract
|
// @param startIndex Index of the first character to subtract
|
||||||
// @param count Amount of characters to retrieve
|
// @param count Amount of characters to retrieve
|
||||||
@@ -236,7 +230,6 @@ public:
|
|||||||
}
|
}
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
|
||||||
// Get pointer to the string
|
// Get pointer to the string
|
||||||
// @returns Pointer to Array of Chars if Num, otherwise the empty string
|
// @returns Pointer to Array of Chars if Num, otherwise the empty string
|
||||||
FORCE_INLINE const Char* operator*() const
|
FORCE_INLINE const Char* operator*() const
|
||||||
@@ -264,7 +257,6 @@ public:
|
|||||||
}
|
}
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
|
||||||
String ToString() const
|
String ToString() const
|
||||||
{
|
{
|
||||||
return String(_data.Get(), _data.Count());
|
return String(_data.Get(), _data.Count());
|
||||||
|
|||||||
@@ -13,7 +13,6 @@ template<typename T>
|
|||||||
class StringViewBase
|
class StringViewBase
|
||||||
{
|
{
|
||||||
protected:
|
protected:
|
||||||
|
|
||||||
const T* _data;
|
const T* _data;
|
||||||
int32 _length;
|
int32 _length;
|
||||||
|
|
||||||
@@ -30,7 +29,6 @@ protected:
|
|||||||
}
|
}
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Gets the specific const character from this string.
|
/// Gets the specific const character from this string.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
@@ -41,7 +39,7 @@ public:
|
|||||||
ASSERT(index >= 0 && index <= _length);
|
ASSERT(index >= 0 && index <= _length);
|
||||||
return _data[index];
|
return _data[index];
|
||||||
}
|
}
|
||||||
|
|
||||||
FORCE_INLINE StringViewBase& operator=(const StringViewBase& other)
|
FORCE_INLINE StringViewBase& operator=(const StringViewBase& other)
|
||||||
{
|
{
|
||||||
if (this != &other)
|
if (this != &other)
|
||||||
@@ -53,8 +51,7 @@ public:
|
|||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Lexicographically tests how this string compares to the other given string.
|
/// Lexicographically tests how this string compares to the other given string. In case sensitive mode 'A' is less than 'a'.
|
||||||
/// In case sensitive mode 'A' is less than 'a'.
|
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <param name="str">The another string test against.</param>
|
/// <param name="str">The another string test against.</param>
|
||||||
/// <param name="searchCase">The case sensitivity mode.</param>
|
/// <param name="searchCase">The case sensitivity mode.</param>
|
||||||
@@ -63,9 +60,7 @@ public:
|
|||||||
{
|
{
|
||||||
const bool thisIsShorter = Length() < str.Length();
|
const bool thisIsShorter = Length() < str.Length();
|
||||||
const int32 minLength = thisIsShorter ? Length() : str.Length();
|
const int32 minLength = thisIsShorter ? Length() : str.Length();
|
||||||
const int32 prefixCompare = (searchCase == StringSearchCase::CaseSensitive)
|
const int32 prefixCompare = searchCase == StringSearchCase::CaseSensitive ? StringUtils::Compare(GetNonTerminatedText(), str.GetNonTerminatedText(), minLength) : StringUtils::CompareIgnoreCase(GetNonTerminatedText(), str.GetNonTerminatedText(), minLength);
|
||||||
? StringUtils::Compare(this->GetNonTerminatedText(), str.GetNonTerminatedText(), minLength)
|
|
||||||
: StringUtils::CompareIgnoreCase(this->GetNonTerminatedText(), str.GetNonTerminatedText(), minLength);
|
|
||||||
if (prefixCompare != 0)
|
if (prefixCompare != 0)
|
||||||
return prefixCompare;
|
return prefixCompare;
|
||||||
if (Length() == str.Length())
|
if (Length() == str.Length())
|
||||||
@@ -74,7 +69,6 @@ public:
|
|||||||
}
|
}
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Returns true if string is empty.
|
/// Returns true if string is empty.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
@@ -124,7 +118,6 @@ public:
|
|||||||
}
|
}
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Searches the string for the occurrence of a character.
|
/// Searches the string for the occurrence of a character.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
@@ -205,14 +198,12 @@ public:
|
|||||||
API_CLASS(InBuild) class FLAXENGINE_API StringView : public StringViewBase<Char>
|
API_CLASS(InBuild) class FLAXENGINE_API StringView : public StringViewBase<Char>
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Instance of the empty string.
|
/// Instance of the empty string.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
static StringView Empty;
|
static StringView Empty;
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Initializes a new instance of the <see cref="StringView"/> class.
|
/// Initializes a new instance of the <see cref="StringView"/> class.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
@@ -257,7 +248,6 @@ public:
|
|||||||
}
|
}
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Assigns the static string.
|
/// Assigns the static string.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
@@ -325,7 +315,6 @@ public:
|
|||||||
bool operator!=(const String& other) const;
|
bool operator!=(const String& other) const;
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Gets the left most given number of characters.
|
/// Gets the left most given number of characters.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
@@ -356,7 +345,6 @@ public:
|
|||||||
StringView Substring(int32 startIndex, int32 count) const;
|
StringView Substring(int32 startIndex, int32 count) const;
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
|
||||||
String ToString() const;
|
String ToString() const;
|
||||||
StringAnsi ToStringAnsi() const;
|
StringAnsi ToStringAnsi() const;
|
||||||
};
|
};
|
||||||
@@ -394,14 +382,12 @@ namespace fmt
|
|||||||
API_CLASS(InBuild) class FLAXENGINE_API StringAnsiView : public StringViewBase<char>
|
API_CLASS(InBuild) class FLAXENGINE_API StringAnsiView : public StringViewBase<char>
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Instance of the empty string.
|
/// Instance of the empty string.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
static StringAnsiView Empty;
|
static StringAnsiView Empty;
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Initializes a new instance of the <see cref="StringView"/> class.
|
/// Initializes a new instance of the <see cref="StringView"/> class.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
@@ -446,7 +432,6 @@ public:
|
|||||||
}
|
}
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Assigns the static string.
|
/// Assigns the static string.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
@@ -514,7 +499,6 @@ public:
|
|||||||
bool operator!=(const StringAnsi& other) const;
|
bool operator!=(const StringAnsi& other) const;
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Retrieves substring created from characters starting from startIndex to the String end.
|
/// Retrieves substring created from characters starting from startIndex to the String end.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
@@ -531,7 +515,6 @@ public:
|
|||||||
StringAnsi Substring(int32 startIndex, int32 count) const;
|
StringAnsi Substring(int32 startIndex, int32 count) const;
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
|
||||||
String ToString() const;
|
String ToString() const;
|
||||||
StringAnsi ToStringAnsi() const;
|
StringAnsi ToStringAnsi() const;
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -33,14 +33,12 @@ namespace Constants
|
|||||||
API_STRUCT(InBuild, Namespace="System") struct FLAXENGINE_API TimeSpan
|
API_STRUCT(InBuild, Namespace="System") struct FLAXENGINE_API TimeSpan
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Time span in 100 nanoseconds resolution.
|
/// Time span in 100 nanoseconds resolution.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
int64 Ticks;
|
int64 Ticks;
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Empty constructor.
|
/// Empty constructor.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
@@ -88,7 +86,6 @@ public:
|
|||||||
}
|
}
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
|
||||||
// Get string
|
// Get string
|
||||||
String ToString() const;
|
String ToString() const;
|
||||||
|
|
||||||
@@ -99,7 +96,6 @@ public:
|
|||||||
String ToString(const char option) const;
|
String ToString(const char option) const;
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
|
||||||
FORCE_INLINE TimeSpan operator+(const TimeSpan& other) const
|
FORCE_INLINE TimeSpan operator+(const TimeSpan& other) const
|
||||||
{
|
{
|
||||||
return TimeSpan(Ticks + other.Ticks);
|
return TimeSpan(Ticks + other.Ticks);
|
||||||
@@ -169,7 +165,6 @@ public:
|
|||||||
}
|
}
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Gets the days component of this time span.
|
/// Gets the days component of this time span.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
@@ -259,7 +254,6 @@ public:
|
|||||||
}
|
}
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Creates a time span that represents the specified number of days.
|
/// Creates a time span that represents the specified number of days.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
@@ -296,7 +290,6 @@ public:
|
|||||||
static TimeSpan FromSeconds(double seconds);
|
static TimeSpan FromSeconds(double seconds);
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Returns the maximum time span value.
|
/// Returns the maximum time span value.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
@@ -325,7 +318,6 @@ public:
|
|||||||
}
|
}
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
|
||||||
void Set(int32 days, int32 hours, int32 minutes, int32 seconds, int32 milliseconds);
|
void Set(int32 days, int32 hours, int32 minutes, int32 seconds, int32 milliseconds);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
@@ -78,7 +78,6 @@ API_STRUCT(InBuild) struct FLAXENGINE_API VariantType
|
|||||||
};
|
};
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// The type of the variant.
|
/// The type of the variant.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
@@ -90,7 +89,6 @@ public:
|
|||||||
char* TypeName;
|
char* TypeName;
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
|
||||||
FORCE_INLINE VariantType()
|
FORCE_INLINE VariantType()
|
||||||
{
|
{
|
||||||
Type = Null;
|
Type = Null;
|
||||||
@@ -116,7 +114,6 @@ public:
|
|||||||
}
|
}
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
|
||||||
VariantType& operator=(const Types& type);
|
VariantType& operator=(const Types& type);
|
||||||
VariantType& operator=(VariantType&& other);
|
VariantType& operator=(VariantType&& other);
|
||||||
VariantType& operator=(const VariantType& other);
|
VariantType& operator=(const VariantType& other);
|
||||||
@@ -129,7 +126,6 @@ public:
|
|||||||
}
|
}
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
|
||||||
void SetTypeName(const StringView& typeName);
|
void SetTypeName(const StringView& typeName);
|
||||||
void SetTypeName(const StringAnsiView& typeName);
|
void SetTypeName(const StringAnsiView& typeName);
|
||||||
const char* GetTypeName() const;
|
const char* GetTypeName() const;
|
||||||
@@ -179,7 +175,6 @@ API_STRUCT(InBuild) struct FLAXENGINE_API Variant
|
|||||||
};
|
};
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
|
||||||
// 0.0f (floating-point value type)
|
// 0.0f (floating-point value type)
|
||||||
static const Variant Zero;
|
static const Variant Zero;
|
||||||
|
|
||||||
@@ -196,7 +191,6 @@ public:
|
|||||||
static const Variant True;
|
static const Variant True;
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
|
||||||
FORCE_INLINE Variant()
|
FORCE_INLINE Variant()
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
@@ -252,7 +246,6 @@ public:
|
|||||||
~Variant();
|
~Variant();
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
|
||||||
Variant& operator=(Variant&& other);
|
Variant& operator=(Variant&& other);
|
||||||
Variant& operator=(const Variant& other);
|
Variant& operator=(const Variant& other);
|
||||||
bool operator==(const Variant& other) const;
|
bool operator==(const Variant& other) const;
|
||||||
@@ -279,7 +272,6 @@ public:
|
|||||||
}
|
}
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
|
||||||
explicit operator bool() const;
|
explicit operator bool() const;
|
||||||
explicit operator Char() const;
|
explicit operator Char() const;
|
||||||
explicit operator int8() const;
|
explicit operator int8() const;
|
||||||
@@ -293,8 +285,8 @@ public:
|
|||||||
explicit operator float() const;
|
explicit operator float() const;
|
||||||
explicit operator double() const;
|
explicit operator double() const;
|
||||||
explicit operator void*() const;
|
explicit operator void*() const;
|
||||||
explicit operator StringView() const; // Returned StringView, if not empty, is guaranteed to point to a null terminated buffer.
|
explicit operator StringView() const; // Returned StringView, if not empty, is guaranteed to point to a null terminated buffer.
|
||||||
explicit operator StringAnsiView() const; // Returned StringView, if not empty, is guaranteed to point to a null terminated buffer.
|
explicit operator StringAnsiView() const; // Returned StringView, if not empty, is guaranteed to point to a null terminated buffer.
|
||||||
explicit operator ScriptingObject*() const;
|
explicit operator ScriptingObject*() const;
|
||||||
explicit operator struct _MonoObject*() const;
|
explicit operator struct _MonoObject*() const;
|
||||||
explicit operator Asset*() const;
|
explicit operator Asset*() const;
|
||||||
@@ -346,7 +338,6 @@ public:
|
|||||||
const Array<Variant, HeapAllocation>& AsArray() const;
|
const Array<Variant, HeapAllocation>& AsArray() const;
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
|
||||||
void SetType(const VariantType& type);
|
void SetType(const VariantType& type);
|
||||||
void SetType(VariantType&& type);
|
void SetType(VariantType&& type);
|
||||||
void SetString(const StringView& str);
|
void SetString(const StringView& str);
|
||||||
@@ -366,7 +357,6 @@ public:
|
|||||||
}
|
}
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
|
||||||
template<typename T>
|
template<typename T>
|
||||||
static typename TEnableIf<TIsEnum<T>::Value, Variant>::Type Enum(VariantType&& type, const T value)
|
static typename TEnableIf<TIsEnum<T>::Value, Variant>::Type Enum(VariantType&& type, const T value)
|
||||||
{
|
{
|
||||||
@@ -393,7 +383,6 @@ public:
|
|||||||
static Variant Lerp(const Variant& a, const Variant& b, float alpha);
|
static Variant Lerp(const Variant& a, const Variant& b, float alpha);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
|
||||||
void OnObjectDeleted(ScriptingObject* obj)
|
void OnObjectDeleted(ScriptingObject* obj)
|
||||||
{
|
{
|
||||||
AsObject = nullptr;
|
AsObject = nullptr;
|
||||||
|
|||||||
@@ -12,14 +12,12 @@
|
|||||||
struct FLAXENGINE_API Version
|
struct FLAXENGINE_API Version
|
||||||
{
|
{
|
||||||
private:
|
private:
|
||||||
|
|
||||||
int32 _major;
|
int32 _major;
|
||||||
int32 _minor;
|
int32 _minor;
|
||||||
int32 _build;
|
int32 _build;
|
||||||
int32 _revision;
|
int32 _revision;
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Initializes a new instance of the Version class with the specified major, minor, build, and revision numbers.
|
/// Initializes a new instance of the Version class with the specified major, minor, build, and revision numbers.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
@@ -74,7 +72,6 @@ public:
|
|||||||
}
|
}
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Gets the value of the build component of the version number for the current Version object.
|
/// Gets the value of the build component of the version number for the current Version object.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
@@ -130,7 +127,6 @@ public:
|
|||||||
}
|
}
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Compares the current Version object to a specified Version object and returns an indication of their relative values.
|
/// Compares the current Version object to a specified Version object and returns an indication of their relative values.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
@@ -209,7 +205,6 @@ public:
|
|||||||
}
|
}
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Converts the value of the current Version object to its equivalent <see cref="T:String" /> representation.
|
/// Converts the value of the current Version object to its equivalent <see cref="T:String" /> representation.
|
||||||
/// A specified count indicates the number of components to return.
|
/// A specified count indicates the number of components to return.
|
||||||
@@ -221,7 +216,6 @@ public:
|
|||||||
String ToString() const;
|
String ToString() const;
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Try to parse Version from string.
|
/// Try to parse Version from string.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
|||||||
@@ -26,7 +26,7 @@ class SceneRenderTask;
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
API_CLASS(Abstract) class FLAXENGINE_API Actor : public SceneObject
|
API_CLASS(Abstract) class FLAXENGINE_API Actor : public SceneObject
|
||||||
{
|
{
|
||||||
DECLARE_SCENE_OBJECT(Actor);
|
DECLARE_SCENE_OBJECT(Actor);
|
||||||
friend Level;
|
friend Level;
|
||||||
friend PrefabManager;
|
friend PrefabManager;
|
||||||
friend Scene;
|
friend Scene;
|
||||||
@@ -35,7 +35,6 @@ DECLARE_SCENE_OBJECT(Actor);
|
|||||||
friend PrefabInstanceData;
|
friend PrefabInstanceData;
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
|
|
||||||
int8 _isActive : 1;
|
int8 _isActive : 1;
|
||||||
int8 _isActiveInHierarchy : 1;
|
int8 _isActiveInHierarchy : 1;
|
||||||
int8 _isPrefabRoot : 1;
|
int8 _isPrefabRoot : 1;
|
||||||
@@ -53,13 +52,11 @@ protected:
|
|||||||
PhysicsScene* _physicsScene;
|
PhysicsScene* _physicsScene;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
|
||||||
// Disable copying
|
// Disable copying
|
||||||
Actor(Actor const&) = delete;
|
Actor(Actor const&) = delete;
|
||||||
Actor& operator=(Actor const&) = delete;
|
Actor& operator=(Actor const&) = delete;
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// List with all child actors attached to the actor (readonly). All items are valid (not null).
|
/// List with all child actors attached to the actor (readonly). All items are valid (not null).
|
||||||
/// </summary>
|
/// </summary>
|
||||||
@@ -79,7 +76,6 @@ public:
|
|||||||
HideFlags HideFlags;
|
HideFlags HideFlags;
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Gets the object layer (index). Can be used for selective rendering or ignoring raycasts.
|
/// Gets the object layer (index). Can be used for selective rendering or ignoring raycasts.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
@@ -164,7 +160,6 @@ public:
|
|||||||
API_PROPERTY() void SetName(const StringView& value);
|
API_PROPERTY() void SetName(const StringView& value);
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Gets the scene object which contains this actor.
|
/// Gets the scene object which contains this actor.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
@@ -251,7 +246,6 @@ public:
|
|||||||
API_FUNCTION(Attributes="NoAnimate") void DestroyChildren(float timeLeft = 0.0f);
|
API_FUNCTION(Attributes="NoAnimate") void DestroyChildren(float timeLeft = 0.0f);
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Gets amount of scripts.
|
/// Gets amount of scripts.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
@@ -308,7 +302,6 @@ public:
|
|||||||
}
|
}
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Gets value indicating if actor is active in the scene.
|
/// Gets value indicating if actor is active in the scene.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
@@ -401,7 +394,6 @@ public:
|
|||||||
}
|
}
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Gets the actor's world transformation.
|
/// Gets the actor's world transformation.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
@@ -475,7 +467,6 @@ public:
|
|||||||
API_PROPERTY() void SetRotation(const Matrix& value);
|
API_PROPERTY() void SetRotation(const Matrix& value);
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Gets the random per-instance value (normalized to range 0-1).
|
/// Gets the random per-instance value (normalized to range 0-1).
|
||||||
/// </summary>
|
/// </summary>
|
||||||
@@ -501,7 +492,6 @@ public:
|
|||||||
API_PROPERTY() void SetDirection(const Float3& value);
|
API_PROPERTY() void SetDirection(const Float3& value);
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Resets the actor local transform.
|
/// Resets the actor local transform.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
@@ -599,7 +589,6 @@ public:
|
|||||||
}
|
}
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Gets actor bounding sphere that defines 3D space intersecting with the actor (for determination of the visibility for actor).
|
/// Gets actor bounding sphere that defines 3D space intersecting with the actor (for determination of the visibility for actor).
|
||||||
/// </summary>
|
/// </summary>
|
||||||
@@ -646,7 +635,6 @@ public:
|
|||||||
void UnregisterObjectHierarchy();
|
void UnregisterObjectHierarchy();
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Draws this actor. Called by Scene Rendering service. This call is more optimized than generic Draw (eg. geometry is rendered during all pass types but other actors are drawn only during GBufferFill pass).
|
/// Draws this actor. Called by Scene Rendering service. This call is more optimized than generic Draw (eg. geometry is rendered during all pass types but other actors are drawn only during GBufferFill pass).
|
||||||
/// </summary>
|
/// </summary>
|
||||||
@@ -668,7 +656,6 @@ public:
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Changes the script order.
|
/// Changes the script order.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
@@ -689,7 +676,6 @@ public:
|
|||||||
API_PROPERTY() bool IsPrefabRoot() const;
|
API_PROPERTY() bool IsPrefabRoot() const;
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Tries to find the actor with the given name in this actor hierarchy (checks this actor and all children hierarchy).
|
/// Tries to find the actor with the given name in this actor hierarchy (checks this actor and all children hierarchy).
|
||||||
/// </summary>
|
/// </summary>
|
||||||
@@ -790,7 +776,6 @@ public:
|
|||||||
API_FUNCTION() Quaternion LookingAt(const Vector3& worldPos, const Vector3& worldUp) const;
|
API_FUNCTION() Quaternion LookingAt(const Vector3& worldPos, const Vector3& worldUp) const;
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Execute custom action on actors tree.
|
/// Execute custom action on actors tree.
|
||||||
/// Action should returns false to stop calling deeper.
|
/// Action should returns false to stop calling deeper.
|
||||||
@@ -827,7 +812,6 @@ public:
|
|||||||
}
|
}
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Performs actors serialization to the raw bytes.
|
/// Performs actors serialization to the raw bytes.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
@@ -887,7 +871,6 @@ public:
|
|||||||
API_FUNCTION() void FromJson(const StringAnsiView& json);
|
API_FUNCTION() void FromJson(const StringAnsiView& json);
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Called when actor gets added to game systems. Occurs on BeginPlay event or when actor gets activated in hierarchy. Use this event to register object to other game system (eg. audio).
|
/// Called when actor gets added to game systems. Occurs on BeginPlay event or when actor gets activated in hierarchy. Use this event to register object to other game system (eg. audio).
|
||||||
/// </summary>
|
/// </summary>
|
||||||
@@ -969,10 +952,11 @@ public:
|
|||||||
API_PROPERTY(Attributes="HideInEditor") PhysicsScene* GetPhysicsScene() const;
|
API_PROPERTY(Attributes="HideInEditor") PhysicsScene* GetPhysicsScene() const;
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
virtual void OnPhysicsSceneChanged(PhysicsScene* previous) {}
|
virtual void OnPhysicsSceneChanged(PhysicsScene* previous)
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
|
||||||
void SetSceneInHierarchy(Scene* scene);
|
void SetSceneInHierarchy(Scene* scene);
|
||||||
void OnEnableInHierarchy();
|
void OnEnableInHierarchy();
|
||||||
void OnDisableInHierarchy();
|
void OnDisableInHierarchy();
|
||||||
@@ -982,7 +966,6 @@ private:
|
|||||||
static bool IsSubClassOf(const Script* object, const MClass* klass);
|
static bool IsSubClassOf(const Script* object, const MClass* klass);
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
|
||||||
// [ScriptingObject]
|
// [ScriptingObject]
|
||||||
String ToString() const override;
|
String ToString() const override;
|
||||||
void OnDeleteObject() override;
|
void OnDeleteObject() override;
|
||||||
|
|||||||
@@ -693,9 +693,9 @@ void AnimatedModel::Update()
|
|||||||
void AnimatedModel::Draw(RenderContext& renderContext)
|
void AnimatedModel::Draw(RenderContext& renderContext)
|
||||||
{
|
{
|
||||||
if (renderContext.View.Pass == DrawPass::GlobalSDF)
|
if (renderContext.View.Pass == DrawPass::GlobalSDF)
|
||||||
return; // TODO: Animated Model rendering to Global SDF
|
return; // TODO: Animated Model rendering to Global SDF
|
||||||
if (renderContext.View.Pass == DrawPass::GlobalSurfaceAtlas)
|
if (renderContext.View.Pass == DrawPass::GlobalSurfaceAtlas)
|
||||||
return; // No supported
|
return; // No supported
|
||||||
GEOMETRY_DRAW_STATE_EVENT_BEGIN(_drawState, _world);
|
GEOMETRY_DRAW_STATE_EVENT_BEGIN(_drawState, _world);
|
||||||
|
|
||||||
const DrawPass drawModes = (DrawPass)(DrawModes & renderContext.View.Pass & (int32)renderContext.View.GetShadowsDrawPassMask(ShadowsMode));
|
const DrawPass drawModes = (DrawPass)(DrawModes & renderContext.View.Pass & (int32)renderContext.View.GetShadowsDrawPassMask(ShadowsMode));
|
||||||
|
|||||||
@@ -14,10 +14,9 @@
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
API_CLASS() class FLAXENGINE_API AnimatedModel : public ModelInstanceActor
|
API_CLASS() class FLAXENGINE_API AnimatedModel : public ModelInstanceActor
|
||||||
{
|
{
|
||||||
DECLARE_SCENE_OBJECT(AnimatedModel);
|
DECLARE_SCENE_OBJECT(AnimatedModel);
|
||||||
friend class AnimationsSystem;
|
friend class AnimationsSystem;
|
||||||
public:
|
public:
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Describes the animation graph updates frequency for the animated model.
|
/// Describes the animation graph updates frequency for the animated model.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
@@ -55,7 +54,6 @@ public:
|
|||||||
};
|
};
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
|
||||||
BoundingBox _boxLocal;
|
BoundingBox _boxLocal;
|
||||||
Matrix _world;
|
Matrix _world;
|
||||||
GeometryDrawStateData _drawState;
|
GeometryDrawStateData _drawState;
|
||||||
@@ -68,7 +66,6 @@ private:
|
|||||||
ScriptingObjectReference<AnimatedModel> _masterPose;
|
ScriptingObjectReference<AnimatedModel> _masterPose;
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// The skinned model asset used for rendering.
|
/// The skinned model asset used for rendering.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
@@ -154,7 +151,6 @@ public:
|
|||||||
ScriptingObjectReference<Actor> RootMotionTarget;
|
ScriptingObjectReference<Actor> RootMotionTarget;
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// The graph instance data container. For dynamic usage only at runtime, not serialized.
|
/// The graph instance data container. For dynamic usage only at runtime, not serialized.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
@@ -238,7 +234,6 @@ public:
|
|||||||
API_FUNCTION() void SetMasterPoseModel(AnimatedModel* masterPose);
|
API_FUNCTION() void SetMasterPoseModel(AnimatedModel* masterPose);
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Gets the anim graph instance parameters collection.
|
/// Gets the anim graph instance parameters collection.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
@@ -283,7 +278,6 @@ public:
|
|||||||
API_FUNCTION() void SetParameterValue(const Guid& id, const Variant& value);
|
API_FUNCTION() void SetParameterValue(const Guid& id, const Variant& value);
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Gets the weight of the blend shape.
|
/// Gets the weight of the blend shape.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
@@ -304,7 +298,6 @@ public:
|
|||||||
API_FUNCTION() void ClearBlendShapeWeights();
|
API_FUNCTION() void ClearBlendShapeWeights();
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Plays the animation on the slot in Anim Graph.
|
/// Plays the animation on the slot in Anim Graph.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
@@ -353,7 +346,6 @@ public:
|
|||||||
API_FUNCTION() bool IsPlayingSlotAnimation(const StringView& slotName, Animation* anim);
|
API_FUNCTION() bool IsPlayingSlotAnimation(const StringView& slotName, Animation* anim);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
|
||||||
void ApplyRootMotion(const RootMotionData& rootMotionDelta);
|
void ApplyRootMotion(const RootMotionData& rootMotionDelta);
|
||||||
void SyncParameters();
|
void SyncParameters();
|
||||||
|
|
||||||
@@ -372,7 +364,6 @@ private:
|
|||||||
void OnGraphLoaded();
|
void OnGraphLoaded();
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
|
||||||
// [ModelInstanceActor]
|
// [ModelInstanceActor]
|
||||||
bool HasContentLoaded() const override;
|
bool HasContentLoaded() const override;
|
||||||
void Draw(RenderContext& renderContext) override;
|
void Draw(RenderContext& renderContext) override;
|
||||||
@@ -387,7 +378,6 @@ public:
|
|||||||
bool IntersectsEntry(const Ray& ray, Real& distance, Vector3& normal, int32& entryIndex) override;
|
bool IntersectsEntry(const Ray& ray, Real& distance, Vector3& normal, int32& entryIndex) override;
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
|
|
||||||
// [ModelInstanceActor]
|
// [ModelInstanceActor]
|
||||||
void BeginPlay(SceneBeginData* data) override;
|
void BeginPlay(SceneBeginData* data) override;
|
||||||
void EndPlay() override;
|
void EndPlay() override;
|
||||||
|
|||||||
@@ -104,7 +104,7 @@ void BoneSocket::OnParentChanged()
|
|||||||
{
|
{
|
||||||
// Base
|
// Base
|
||||||
Actor::OnParentChanged();
|
Actor::OnParentChanged();
|
||||||
|
|
||||||
if (!IsDuringPlay())
|
if (!IsDuringPlay())
|
||||||
return;
|
return;
|
||||||
|
|
||||||
|
|||||||
@@ -9,16 +9,14 @@
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
API_CLASS() class FLAXENGINE_API BoneSocket : public Actor
|
API_CLASS() class FLAXENGINE_API BoneSocket : public Actor
|
||||||
{
|
{
|
||||||
DECLARE_SCENE_OBJECT(BoneSocket);
|
DECLARE_SCENE_OBJECT(BoneSocket);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
|
||||||
String _node;
|
String _node;
|
||||||
int32 _index;
|
int32 _index;
|
||||||
bool _useScale;
|
bool _useScale;
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Gets the target node name to link to it.
|
/// Gets the target node name to link to it.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
@@ -54,7 +52,6 @@ public:
|
|||||||
void SetUseScale(bool value);
|
void SetUseScale(bool value);
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Updates the actor transformation based on a skeleton node.
|
/// Updates the actor transformation based on a skeleton node.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
@@ -62,7 +59,6 @@ public:
|
|||||||
void UpdateTransformation();
|
void UpdateTransformation();
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
|
||||||
// [Actor]
|
// [Actor]
|
||||||
#if USE_EDITOR
|
#if USE_EDITOR
|
||||||
void OnDebugDrawSelected() override;
|
void OnDebugDrawSelected() override;
|
||||||
@@ -71,7 +67,6 @@ public:
|
|||||||
void Deserialize(DeserializeStream& stream, ISerializeModifier* modifier) override;
|
void Deserialize(DeserializeStream& stream, ISerializeModifier* modifier) override;
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
|
|
||||||
// [Actor]
|
// [Actor]
|
||||||
void OnTransformChanged() override;
|
void OnTransformChanged() override;
|
||||||
void OnParentChanged() override;
|
void OnParentChanged() override;
|
||||||
|
|||||||
@@ -12,7 +12,7 @@
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
API_STRUCT() struct BrushSurface : ISerializable
|
API_STRUCT() struct BrushSurface : ISerializable
|
||||||
{
|
{
|
||||||
DECLARE_SCRIPTING_TYPE_NO_SPAWN(BrushSurface);
|
DECLARE_SCRIPTING_TYPE_NO_SPAWN(BrushSurface);
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// The parent brush.
|
/// The parent brush.
|
||||||
@@ -57,7 +57,6 @@ DECLARE_SCRIPTING_TYPE_NO_SPAWN(BrushSurface);
|
|||||||
float ScaleInLightmap = 1.0f;
|
float ScaleInLightmap = 1.0f;
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
|
||||||
// [ISerializable]
|
// [ISerializable]
|
||||||
void Serialize(SerializeStream& stream, const void* otherObj) override;
|
void Serialize(SerializeStream& stream, const void* otherObj) override;
|
||||||
void Deserialize(DeserializeStream& stream, ISerializeModifier* modifier) override;
|
void Deserialize(DeserializeStream& stream, ISerializeModifier* modifier) override;
|
||||||
@@ -68,16 +67,14 @@ public:
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
API_CLASS() class FLAXENGINE_API BoxBrush : public Actor, public CSG::Brush
|
API_CLASS() class FLAXENGINE_API BoxBrush : public Actor, public CSG::Brush
|
||||||
{
|
{
|
||||||
DECLARE_SCENE_OBJECT(BoxBrush);
|
DECLARE_SCENE_OBJECT(BoxBrush);
|
||||||
private:
|
private:
|
||||||
|
|
||||||
Vector3 _center;
|
Vector3 _center;
|
||||||
Vector3 _size;
|
Vector3 _size;
|
||||||
OrientedBoundingBox _bounds;
|
OrientedBoundingBox _bounds;
|
||||||
BrushMode _mode;
|
BrushMode _mode;
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Brush surfaces scale in lightmap
|
/// Brush surfaces scale in lightmap
|
||||||
/// </summary>
|
/// </summary>
|
||||||
@@ -161,7 +158,6 @@ public:
|
|||||||
API_FUNCTION() void SetMaterial(int32 surfaceIndex, MaterialBase* material);
|
API_FUNCTION() void SetMaterial(int32 surfaceIndex, MaterialBase* material);
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Gets the volume bounding box (oriented).
|
/// Gets the volume bounding box (oriented).
|
||||||
/// </summary>
|
/// </summary>
|
||||||
@@ -191,7 +187,6 @@ public:
|
|||||||
API_FUNCTION() void GetVertices(int32 surfaceIndex, API_PARAM(Out) Array<Vector3>& outputData) const;
|
API_FUNCTION() void GetVertices(int32 surfaceIndex, API_PARAM(Out) Array<Vector3>& outputData) const;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
|
||||||
FORCE_INLINE void UpdateBounds()
|
FORCE_INLINE void UpdateBounds()
|
||||||
{
|
{
|
||||||
OrientedBoundingBox::CreateCentered(_center, _size, _bounds);
|
OrientedBoundingBox::CreateCentered(_center, _size, _bounds);
|
||||||
@@ -201,7 +196,6 @@ private:
|
|||||||
}
|
}
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
|
||||||
// [Actor]
|
// [Actor]
|
||||||
void Serialize(SerializeStream& stream, const void* otherObj) override;
|
void Serialize(SerializeStream& stream, const void* otherObj) override;
|
||||||
void Deserialize(DeserializeStream& stream, ISerializeModifier* modifier) override;
|
void Deserialize(DeserializeStream& stream, ISerializeModifier* modifier) override;
|
||||||
@@ -219,7 +213,6 @@ public:
|
|||||||
int32 GetSurfacesCount() override;
|
int32 GetSurfacesCount() override;
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
|
|
||||||
// [Actor]
|
// [Actor]
|
||||||
void OnTransformChanged() override;
|
void OnTransformChanged() override;
|
||||||
void OnActiveInTreeChanged() override;
|
void OnActiveInTreeChanged() override;
|
||||||
|
|||||||
@@ -10,14 +10,12 @@
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
API_CLASS(Abstract) class FLAXENGINE_API BoxVolume : public Actor
|
API_CLASS(Abstract) class FLAXENGINE_API BoxVolume : public Actor
|
||||||
{
|
{
|
||||||
DECLARE_SCENE_OBJECT(BoxVolume);
|
DECLARE_SCENE_OBJECT(BoxVolume);
|
||||||
protected:
|
protected:
|
||||||
|
|
||||||
Vector3 _size;
|
Vector3 _size;
|
||||||
OrientedBoundingBox _bounds;
|
OrientedBoundingBox _bounds;
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Gets the size of the volume (in local space).
|
/// Gets the size of the volume (in local space).
|
||||||
/// </summary>
|
/// </summary>
|
||||||
@@ -41,7 +39,6 @@ public:
|
|||||||
}
|
}
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
|
|
||||||
virtual void OnBoundsChanged(const BoundingBox& prevBounds)
|
virtual void OnBoundsChanged(const BoundingBox& prevBounds)
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
@@ -51,7 +48,6 @@ protected:
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
|
||||||
// [Actor]
|
// [Actor]
|
||||||
#if USE_EDITOR
|
#if USE_EDITOR
|
||||||
void OnDebugDraw() override;
|
void OnDebugDraw() override;
|
||||||
@@ -61,7 +57,6 @@ public:
|
|||||||
void Deserialize(DeserializeStream& stream, ISerializeModifier* modifier) override;
|
void Deserialize(DeserializeStream& stream, ISerializeModifier* modifier) override;
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
|
|
||||||
// [Actor]
|
// [Actor]
|
||||||
void OnTransformChanged() override;
|
void OnTransformChanged() override;
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -20,7 +20,7 @@
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
API_CLASS(Sealed) class FLAXENGINE_API Camera : public Actor
|
API_CLASS(Sealed) class FLAXENGINE_API Camera : public Actor
|
||||||
{
|
{
|
||||||
DECLARE_SCENE_OBJECT(Camera);
|
DECLARE_SCENE_OBJECT(Camera);
|
||||||
|
|
||||||
// List with all created cameras actors on the scene
|
// List with all created cameras actors on the scene
|
||||||
static Array<Camera*> Cameras;
|
static Array<Camera*> Cameras;
|
||||||
@@ -35,7 +35,6 @@ DECLARE_SCENE_OBJECT(Camera);
|
|||||||
API_PROPERTY() static Camera* GetMainCamera();
|
API_PROPERTY() static Camera* GetMainCamera();
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
|
||||||
Matrix _view, _projection;
|
Matrix _view, _projection;
|
||||||
BoundingFrustum _frustum;
|
BoundingFrustum _frustum;
|
||||||
|
|
||||||
@@ -56,7 +55,6 @@ private:
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Gets the view matrix.
|
/// Gets the view matrix.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
@@ -82,7 +80,6 @@ public:
|
|||||||
}
|
}
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Gets the value indicating if camera should use perspective rendering mode, otherwise it will use orthographic projection.
|
/// Gets the value indicating if camera should use perspective rendering mode, otherwise it will use orthographic projection.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
@@ -174,7 +171,6 @@ public:
|
|||||||
LayersMask RenderLayersMask;
|
LayersMask RenderLayersMask;
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Projects the point from 3D world-space to game window coordinates (in screen pixels for default viewport calculated from <see cref="Viewport"/>).
|
/// Projects the point from 3D world-space to game window coordinates (in screen pixels for default viewport calculated from <see cref="Viewport"/>).
|
||||||
/// </summary>
|
/// </summary>
|
||||||
@@ -231,14 +227,12 @@ public:
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
|
||||||
#if USE_EDITOR
|
#if USE_EDITOR
|
||||||
void OnPreviewModelLoaded();
|
void OnPreviewModelLoaded();
|
||||||
#endif
|
#endif
|
||||||
void UpdateCache();
|
void UpdateCache();
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
|
||||||
// [Actor]
|
// [Actor]
|
||||||
#if USE_EDITOR
|
#if USE_EDITOR
|
||||||
BoundingBox GetEditorBox() const override;
|
BoundingBox GetEditorBox() const override;
|
||||||
@@ -250,7 +244,6 @@ public:
|
|||||||
void Deserialize(DeserializeStream& stream, ISerializeModifier* modifier) override;
|
void Deserialize(DeserializeStream& stream, ISerializeModifier* modifier) override;
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
|
|
||||||
// [Actor]
|
// [Actor]
|
||||||
void OnEnable() override;
|
void OnEnable() override;
|
||||||
void OnDisable() override;
|
void OnDisable() override;
|
||||||
|
|||||||
@@ -12,16 +12,14 @@
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
API_CLASS() class FLAXENGINE_API Decal : public Actor
|
API_CLASS() class FLAXENGINE_API Decal : public Actor
|
||||||
{
|
{
|
||||||
DECLARE_SCENE_OBJECT(Decal);
|
DECLARE_SCENE_OBJECT(Decal);
|
||||||
private:
|
private:
|
||||||
|
|
||||||
Vector3 _size;
|
Vector3 _size;
|
||||||
OrientedBoundingBox _bounds;
|
OrientedBoundingBox _bounds;
|
||||||
Matrix _world;
|
Matrix _world;
|
||||||
int32 _sceneRenderingKey = -1;
|
int32 _sceneRenderingKey = -1;
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// The decal material. Must have domain mode to Decal type.
|
/// The decal material. Must have domain mode to Decal type.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
@@ -56,7 +54,6 @@ public:
|
|||||||
API_PROPERTY() void SetSize(const Vector3& value);
|
API_PROPERTY() void SetSize(const Vector3& value);
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Utility to crate a new virtual Material Instance asset, set its parent to the currently applied material, and assign it to the decal. Can be used to modify the decal material parameters from code.
|
/// Utility to crate a new virtual Material Instance asset, set its parent to the currently applied material, and assign it to the decal. Can be used to modify the decal material parameters from code.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
@@ -73,7 +70,6 @@ public:
|
|||||||
}
|
}
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
|
||||||
// [Actor]
|
// [Actor]
|
||||||
#if USE_EDITOR
|
#if USE_EDITOR
|
||||||
void OnDebugDrawSelected() override;
|
void OnDebugDrawSelected() override;
|
||||||
@@ -86,7 +82,6 @@ public:
|
|||||||
bool IntersectsItself(const Ray& ray, Real& distance, Vector3& normal) override;
|
bool IntersectsItself(const Ray& ray, Real& distance, Vector3& normal) override;
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
|
|
||||||
// [Actor]
|
// [Actor]
|
||||||
void OnEnable() override;
|
void OnEnable() override;
|
||||||
void OnDisable() override;
|
void OnDisable() override;
|
||||||
|
|||||||
@@ -9,16 +9,14 @@
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
API_CLASS() class FLAXENGINE_API EmptyActor : public Actor
|
API_CLASS() class FLAXENGINE_API EmptyActor : public Actor
|
||||||
{
|
{
|
||||||
DECLARE_SCENE_OBJECT(EmptyActor);
|
DECLARE_SCENE_OBJECT(EmptyActor);
|
||||||
public:
|
public:
|
||||||
|
|
||||||
// [Actor]
|
// [Actor]
|
||||||
#if USE_EDITOR
|
#if USE_EDITOR
|
||||||
BoundingBox GetEditorBox() const override;
|
BoundingBox GetEditorBox() const override;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
|
|
||||||
// [Actor]
|
// [Actor]
|
||||||
void OnTransformChanged() override;
|
void OnTransformChanged() override;
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -11,16 +11,14 @@
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
API_CLASS() class FLAXENGINE_API EnvironmentProbe : public Actor
|
API_CLASS() class FLAXENGINE_API EnvironmentProbe : public Actor
|
||||||
{
|
{
|
||||||
DECLARE_SCENE_OBJECT(EnvironmentProbe);
|
DECLARE_SCENE_OBJECT(EnvironmentProbe);
|
||||||
private:
|
private:
|
||||||
|
|
||||||
float _radius;
|
float _radius;
|
||||||
bool _isUsingCustomProbe;
|
bool _isUsingCustomProbe;
|
||||||
int32 _sceneRenderingKey = -1;
|
int32 _sceneRenderingKey = -1;
|
||||||
AssetReference<CubeTexture> _probe;
|
AssetReference<CubeTexture> _probe;
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// The reflections brightness.
|
/// The reflections brightness.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
@@ -40,7 +38,6 @@ public:
|
|||||||
float CaptureNearPlane = 10.0f;
|
float CaptureNearPlane = 10.0f;
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Gets the probe radius.
|
/// Gets the probe radius.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
@@ -108,7 +105,6 @@ public:
|
|||||||
API_PROPERTY() void SetCustomProbe(CubeTexture* probe);
|
API_PROPERTY() void SetCustomProbe(CubeTexture* probe);
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Bakes that probe. It won't be performed now but on async graphics rendering task.
|
/// Bakes that probe. It won't be performed now but on async graphics rendering task.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
@@ -122,11 +118,9 @@ public:
|
|||||||
void SetProbeData(TextureData& data);
|
void SetProbeData(TextureData& data);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
|
||||||
void UpdateBounds();
|
void UpdateBounds();
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
|
||||||
// [Actor]
|
// [Actor]
|
||||||
#if USE_EDITOR
|
#if USE_EDITOR
|
||||||
BoundingBox GetEditorBox() const override
|
BoundingBox GetEditorBox() const override
|
||||||
@@ -146,7 +140,6 @@ public:
|
|||||||
bool IntersectsItself(const Ray& ray, Real& distance, Vector3& normal) override;
|
bool IntersectsItself(const Ray& ray, Real& distance, Vector3& normal) override;
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
|
|
||||||
// [Actor]
|
// [Actor]
|
||||||
void OnEnable() override;
|
void OnEnable() override;
|
||||||
void OnDisable() override;
|
void OnDisable() override;
|
||||||
|
|||||||
@@ -33,10 +33,10 @@ void ExponentialHeightFog::Draw(RenderContext& renderContext)
|
|||||||
{
|
{
|
||||||
// Render only when shader is valid and fog can be rendered
|
// Render only when shader is valid and fog can be rendered
|
||||||
// Do not render exponential fog in orthographic views
|
// Do not render exponential fog in orthographic views
|
||||||
if ((renderContext.View.Flags & ViewFlags::Fog) != 0
|
if ((renderContext.View.Flags & ViewFlags::Fog) != 0
|
||||||
&& renderContext.View.Pass & DrawPass::GBuffer
|
&& renderContext.View.Pass & DrawPass::GBuffer
|
||||||
&& _shader
|
&& _shader
|
||||||
&& _shader->IsLoaded()
|
&& _shader->IsLoaded()
|
||||||
&& renderContext.View.IsPerspectiveProjection())
|
&& renderContext.View.IsPerspectiveProjection())
|
||||||
{
|
{
|
||||||
// Prepare
|
// Prepare
|
||||||
|
|||||||
@@ -11,9 +11,8 @@
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
API_CLASS(Abstract) class FLAXENGINE_API Light : public Actor
|
API_CLASS(Abstract) class FLAXENGINE_API Light : public Actor
|
||||||
{
|
{
|
||||||
DECLARE_SCENE_OBJECT_ABSTRACT(Light);
|
DECLARE_SCENE_OBJECT_ABSTRACT(Light);
|
||||||
public:
|
public:
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Color of the light
|
/// Color of the light
|
||||||
/// </summary>
|
/// </summary>
|
||||||
@@ -51,12 +50,10 @@ public:
|
|||||||
bool CastVolumetricShadow = true;
|
bool CastVolumetricShadow = true;
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
|
|
||||||
// Adjust the light brightness used during rendering (called by light types inside SetupLightData callback)
|
// Adjust the light brightness used during rendering (called by light types inside SetupLightData callback)
|
||||||
void AdjustBrightness(const RenderView& view, float& brightness) const;
|
void AdjustBrightness(const RenderView& view, float& brightness) const;
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
|
||||||
// [Actor]
|
// [Actor]
|
||||||
#if USE_EDITOR
|
#if USE_EDITOR
|
||||||
BoundingBox GetEditorBox() const override
|
BoundingBox GetEditorBox() const override
|
||||||
@@ -74,9 +71,8 @@ public:
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
API_CLASS(Abstract) class FLAXENGINE_API LightWithShadow : public Light
|
API_CLASS(Abstract) class FLAXENGINE_API LightWithShadow : public Light
|
||||||
{
|
{
|
||||||
DECLARE_SCENE_OBJECT_ABSTRACT(LightWithShadow);
|
DECLARE_SCENE_OBJECT_ABSTRACT(LightWithShadow);
|
||||||
public:
|
public:
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// The minimum roughness value used to clamp material surface roughness during shading pixel.
|
/// The minimum roughness value used to clamp material surface roughness during shading pixel.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
@@ -132,7 +128,6 @@ public:
|
|||||||
ShadowsCastingMode ShadowsMode = ShadowsCastingMode::All;
|
ShadowsCastingMode ShadowsMode = ShadowsCastingMode::All;
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
|
||||||
// [Light]
|
// [Light]
|
||||||
void Serialize(SerializeStream& stream, const void* otherObj) override;
|
void Serialize(SerializeStream& stream, const void* otherObj) override;
|
||||||
void Deserialize(DeserializeStream& stream, ISerializeModifier* modifier) override;
|
void Deserialize(DeserializeStream& stream, ISerializeModifier* modifier) override;
|
||||||
|
|||||||
@@ -11,13 +11,11 @@
|
|||||||
/// <seealso cref="Actor" />
|
/// <seealso cref="Actor" />
|
||||||
API_CLASS(Abstract) class FLAXENGINE_API ModelInstanceActor : public Actor
|
API_CLASS(Abstract) class FLAXENGINE_API ModelInstanceActor : public Actor
|
||||||
{
|
{
|
||||||
DECLARE_SCENE_OBJECT_ABSTRACT(ModelInstanceActor);
|
DECLARE_SCENE_OBJECT_ABSTRACT(ModelInstanceActor);
|
||||||
protected:
|
protected:
|
||||||
|
|
||||||
int32 _sceneRenderingKey = -1;
|
int32 _sceneRenderingKey = -1;
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// The model instance buffer.
|
/// The model instance buffer.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
@@ -84,12 +82,10 @@ public:
|
|||||||
}
|
}
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
|
||||||
// [Actor]
|
// [Actor]
|
||||||
void OnLayerChanged() override;
|
void OnLayerChanged() override;
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
|
|
||||||
// [Actor]
|
// [Actor]
|
||||||
void OnEnable() override;
|
void OnEnable() override;
|
||||||
void OnDisable() override;
|
void OnDisable() override;
|
||||||
|
|||||||
@@ -11,16 +11,14 @@
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
API_CLASS() class FLAXENGINE_API PostFxVolume : public BoxVolume, public IPostFxSettingsProvider
|
API_CLASS() class FLAXENGINE_API PostFxVolume : public BoxVolume, public IPostFxSettingsProvider
|
||||||
{
|
{
|
||||||
DECLARE_SCENE_OBJECT(PostFxVolume);
|
DECLARE_SCENE_OBJECT(PostFxVolume);
|
||||||
private:
|
private:
|
||||||
|
|
||||||
int32 _priority;
|
int32 _priority;
|
||||||
float _blendRadius;
|
float _blendRadius;
|
||||||
float _blendWeight;
|
float _blendWeight;
|
||||||
bool _isBounded;
|
bool _isBounded;
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// The ambient occlusion effect settings.
|
/// The ambient occlusion effect settings.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
@@ -100,7 +98,6 @@ public:
|
|||||||
PostFxMaterialsSettings PostFxMaterials;
|
PostFxMaterialsSettings PostFxMaterials;
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Gets the order in which multiple volumes are blended together.
|
/// Gets the order in which multiple volumes are blended together.
|
||||||
/// The volume with the highest priority takes precedence over all other overlapping volumes.
|
/// The volume with the highest priority takes precedence over all other overlapping volumes.
|
||||||
@@ -184,7 +181,6 @@ public:
|
|||||||
}
|
}
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Adds the post fx material to the settings.
|
/// Adds the post fx material to the settings.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
@@ -198,7 +194,6 @@ public:
|
|||||||
API_FUNCTION() void RemovePostFxMaterial(MaterialBase* material);
|
API_FUNCTION() void RemovePostFxMaterial(MaterialBase* material);
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
|
||||||
// [BoxVolume]
|
// [BoxVolume]
|
||||||
bool HasContentLoaded() const override;
|
bool HasContentLoaded() const override;
|
||||||
void Serialize(SerializeStream& stream, const void* otherObj) override;
|
void Serialize(SerializeStream& stream, const void* otherObj) override;
|
||||||
@@ -209,7 +204,6 @@ public:
|
|||||||
void Blend(PostProcessSettings& other, float weight) override;
|
void Blend(PostProcessSettings& other, float weight) override;
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
|
|
||||||
// [BoxVolume]
|
// [BoxVolume]
|
||||||
void OnEnable() override;
|
void OnEnable() override;
|
||||||
void OnDisable() override;
|
void OnDisable() override;
|
||||||
|
|||||||
@@ -10,15 +10,13 @@
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
API_CLASS() class FLAXENGINE_API Ragdoll : public Actor
|
API_CLASS() class FLAXENGINE_API Ragdoll : public Actor
|
||||||
{
|
{
|
||||||
DECLARE_SCENE_OBJECT(Ragdoll);
|
DECLARE_SCENE_OBJECT(Ragdoll);
|
||||||
API_AUTO_SERIALIZATION();
|
API_AUTO_SERIALIZATION();
|
||||||
private:
|
private:
|
||||||
|
|
||||||
AnimatedModel* _animatedModel = nullptr;
|
AnimatedModel* _animatedModel = nullptr;
|
||||||
Dictionary<RigidBody*, Transform> _bonesOffsets;
|
Dictionary<RigidBody*, Transform> _bonesOffsets;
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// The default bones weight where 0 means fully animated bone and 1 means fully simulate bones. Can be used to control all bones simulation mode but is overriden by per-bone BonesWeights.
|
/// The default bones weight where 0 means fully animated bone and 1 means fully simulate bones. Can be used to control all bones simulation mode but is overriden by per-bone BonesWeights.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
@@ -53,7 +51,6 @@ public:
|
|||||||
float MaxDepenetrationVelocity = MAX_float;
|
float MaxDepenetrationVelocity = MAX_float;
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Calculates the total mass of all ragdoll bodies.
|
/// Calculates the total mass of all ragdoll bodies.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
@@ -70,13 +67,11 @@ public:
|
|||||||
API_FUNCTION() void SetAngularVelocity(const Vector3& value) const;
|
API_FUNCTION() void SetAngularVelocity(const Vector3& value) const;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
|
||||||
float InitBone(RigidBody* rigidBody, int32& nodeIndex, Transform& localPose);
|
float InitBone(RigidBody* rigidBody, int32& nodeIndex, Transform& localPose);
|
||||||
void OnFixedUpdate();
|
void OnFixedUpdate();
|
||||||
void OnAnimationUpdating(struct AnimGraphImpulse* localPose);
|
void OnAnimationUpdating(struct AnimGraphImpulse* localPose);
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
|
||||||
// [Actor]
|
// [Actor]
|
||||||
void OnEnable() override;
|
void OnEnable() override;
|
||||||
void OnDisable() override;
|
void OnDisable() override;
|
||||||
|
|||||||
@@ -10,15 +10,13 @@
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
API_CLASS() class FLAXENGINE_API Spline : public Actor
|
API_CLASS() class FLAXENGINE_API Spline : public Actor
|
||||||
{
|
{
|
||||||
DECLARE_SCENE_OBJECT(Spline);
|
DECLARE_SCENE_OBJECT(Spline);
|
||||||
typedef BezierCurveKeyframe<Transform> Keyframe;
|
typedef BezierCurveKeyframe<Transform> Keyframe;
|
||||||
private:
|
private:
|
||||||
|
|
||||||
bool _loop = false;
|
bool _loop = false;
|
||||||
BoundingBox _localBounds;
|
BoundingBox _localBounds;
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// The spline bezier curve points represented as series of transformations in 3D space (with tangents). Points are stored in local-space of the actor.
|
/// The spline bezier curve points represented as series of transformations in 3D space (with tangents). Points are stored in local-space of the actor.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
@@ -37,7 +35,6 @@ public:
|
|||||||
API_PROPERTY() void SetIsLoop(bool value);
|
API_PROPERTY() void SetIsLoop(bool value);
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Evaluates the spline curve at the given time and calculates the point location in 3D (world-space).
|
/// Evaluates the spline curve at the given time and calculates the point location in 3D (world-space).
|
||||||
/// </summary>
|
/// </summary>
|
||||||
@@ -215,7 +212,6 @@ public:
|
|||||||
API_FUNCTION() void GetSplineLocalPoints(API_PARAM(Out) Array<Transform>& points) const;
|
API_FUNCTION() void GetSplineLocalPoints(API_PARAM(Out) Array<Transform>& points) const;
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Clears the spline to be empty.
|
/// Clears the spline to be empty.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
@@ -345,7 +341,6 @@ public:
|
|||||||
API_FUNCTION() void SetTangentsSmooth();
|
API_FUNCTION() void SetTangentsSmooth();
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Called when spline gets updated (eg. after curve modification).
|
/// Called when spline gets updated (eg. after curve modification).
|
||||||
/// </summary>
|
/// </summary>
|
||||||
@@ -357,7 +352,6 @@ public:
|
|||||||
API_FUNCTION() virtual void UpdateSpline();
|
API_FUNCTION() virtual void UpdateSpline();
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
|
|
||||||
#if USE_EDITOR
|
#if USE_EDITOR
|
||||||
virtual Color GetSplineColor()
|
virtual Color GetSplineColor()
|
||||||
{
|
{
|
||||||
@@ -366,7 +360,6 @@ protected:
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
|
||||||
// Internal bindings
|
// Internal bindings
|
||||||
#if !COMPILE_WITHOUT_CSHARP
|
#if !COMPILE_WITHOUT_CSHARP
|
||||||
API_FUNCTION(NoProxy) void GetKeyframes(MonoArray* data);
|
API_FUNCTION(NoProxy) void GetKeyframes(MonoArray* data);
|
||||||
@@ -374,7 +367,6 @@ private:
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
|
||||||
// [Actor]
|
// [Actor]
|
||||||
#if USE_EDITOR
|
#if USE_EDITOR
|
||||||
void OnDebugDraw() override;
|
void OnDebugDraw() override;
|
||||||
|
|||||||
@@ -351,9 +351,9 @@ void SplineModel::Draw(RenderContext& renderContext)
|
|||||||
return;
|
return;
|
||||||
auto model = Model.Get();
|
auto model = Model.Get();
|
||||||
if (renderContext.View.Pass == DrawPass::GlobalSDF)
|
if (renderContext.View.Pass == DrawPass::GlobalSDF)
|
||||||
return; // TODO: Spline Model rendering to Global SDF
|
return; // TODO: Spline Model rendering to Global SDF
|
||||||
if (renderContext.View.Pass == DrawPass::GlobalSurfaceAtlas)
|
if (renderContext.View.Pass == DrawPass::GlobalSurfaceAtlas)
|
||||||
return; // TODO: Spline Model rendering to Global Surface Atlas
|
return; // TODO: Spline Model rendering to Global Surface Atlas
|
||||||
if (!Entries.IsValidFor(model))
|
if (!Entries.IsValidFor(model))
|
||||||
Entries.Setup(model);
|
Entries.Setup(model);
|
||||||
|
|
||||||
|
|||||||
@@ -12,9 +12,8 @@ class Spline;
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
API_CLASS() class FLAXENGINE_API SplineModel : public ModelInstanceActor
|
API_CLASS() class FLAXENGINE_API SplineModel : public ModelInstanceActor
|
||||||
{
|
{
|
||||||
DECLARE_SCENE_OBJECT(SplineModel);
|
DECLARE_SCENE_OBJECT(SplineModel);
|
||||||
private:
|
private:
|
||||||
|
|
||||||
struct Instance
|
struct Instance
|
||||||
{
|
{
|
||||||
BoundingSphere Sphere;
|
BoundingSphere Sphere;
|
||||||
@@ -33,7 +32,6 @@ private:
|
|||||||
float _chunksPerSegment, _meshMinZ, _meshMaxZ;
|
float _chunksPerSegment, _meshMinZ, _meshMaxZ;
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
|
||||||
~SplineModel();
|
~SplineModel();
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
@@ -104,14 +102,12 @@ public:
|
|||||||
API_PROPERTY() void SetForcedLOD(int32 value);
|
API_PROPERTY() void SetForcedLOD(int32 value);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
|
||||||
void OnModelChanged();
|
void OnModelChanged();
|
||||||
void OnModelLoaded();
|
void OnModelLoaded();
|
||||||
void OnSplineUpdated();
|
void OnSplineUpdated();
|
||||||
void UpdateDeformationBuffer();
|
void UpdateDeformationBuffer();
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
|
||||||
// [ModelInstanceActor]
|
// [ModelInstanceActor]
|
||||||
bool HasContentLoaded() const override;
|
bool HasContentLoaded() const override;
|
||||||
void Draw(RenderContext& renderContext) override;
|
void Draw(RenderContext& renderContext) override;
|
||||||
@@ -121,7 +117,6 @@ public:
|
|||||||
void OnParentChanged() override;
|
void OnParentChanged() override;
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
|
|
||||||
// [ModelInstanceActor]
|
// [ModelInstanceActor]
|
||||||
void OnTransformChanged() override;
|
void OnTransformChanged() override;
|
||||||
void OnActiveInTreeChanged() override;
|
void OnActiveInTreeChanged() override;
|
||||||
|
|||||||
@@ -11,9 +11,8 @@
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
API_CLASS() class FLAXENGINE_API SpotLight : public LightWithShadow
|
API_CLASS() class FLAXENGINE_API SpotLight : public LightWithShadow
|
||||||
{
|
{
|
||||||
DECLARE_SCENE_OBJECT(SpotLight);
|
DECLARE_SCENE_OBJECT(SpotLight);
|
||||||
private:
|
private:
|
||||||
|
|
||||||
Vector3 _direction;
|
Vector3 _direction;
|
||||||
float _radius;
|
float _radius;
|
||||||
float _outerConeAngle;
|
float _outerConeAngle;
|
||||||
@@ -24,7 +23,6 @@ private:
|
|||||||
int32 _sceneRenderingKey = -1;
|
int32 _sceneRenderingKey = -1;
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Light source bulb radius
|
/// Light source bulb radius
|
||||||
/// </summary>
|
/// </summary>
|
||||||
@@ -62,7 +60,6 @@ public:
|
|||||||
float IESBrightnessScale = 1.0f;
|
float IESBrightnessScale = 1.0f;
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Computes light brightness value
|
/// Computes light brightness value
|
||||||
/// </summary>
|
/// </summary>
|
||||||
@@ -122,11 +119,9 @@ public:
|
|||||||
API_PROPERTY() void SetInnerConeAngle(float value);
|
API_PROPERTY() void SetInnerConeAngle(float value);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
|
||||||
void UpdateBounds();
|
void UpdateBounds();
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
|
||||||
// [LightWithShadow]
|
// [LightWithShadow]
|
||||||
void Draw(RenderContext& renderContext) override;
|
void Draw(RenderContext& renderContext) override;
|
||||||
#if USE_EDITOR
|
#if USE_EDITOR
|
||||||
@@ -138,7 +133,6 @@ public:
|
|||||||
bool IntersectsItself(const Ray& ray, Real& distance, Vector3& normal) override;
|
bool IntersectsItself(const Ray& ray, Real& distance, Vector3& normal) override;
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
|
|
||||||
// [LightWithShadow]
|
// [LightWithShadow]
|
||||||
void OnEnable() override;
|
void OnEnable() override;
|
||||||
void OnDisable() override;
|
void OnDisable() override;
|
||||||
|
|||||||
@@ -12,9 +12,8 @@
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
API_CLASS() class FLAXENGINE_API StaticModel : public ModelInstanceActor
|
API_CLASS() class FLAXENGINE_API StaticModel : public ModelInstanceActor
|
||||||
{
|
{
|
||||||
DECLARE_SCENE_OBJECT(StaticModel);
|
DECLARE_SCENE_OBJECT(StaticModel);
|
||||||
private:
|
private:
|
||||||
|
|
||||||
Matrix _world;
|
Matrix _world;
|
||||||
GeometryDrawStateData _drawState;
|
GeometryDrawStateData _drawState;
|
||||||
float _scaleInLightmap;
|
float _scaleInLightmap;
|
||||||
@@ -28,7 +27,6 @@ private:
|
|||||||
Model* _residencyChangedModel = nullptr;
|
Model* _residencyChangedModel = nullptr;
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Finalizes an instance of the <see cref="StaticModel"/> class.
|
/// Finalizes an instance of the <see cref="StaticModel"/> class.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
@@ -52,7 +50,6 @@ public:
|
|||||||
LightmapEntry Lightmap;
|
LightmapEntry Lightmap;
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Gets the model world matrix transform.
|
/// Gets the model world matrix transform.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
@@ -180,14 +177,12 @@ public:
|
|||||||
API_FUNCTION() void RemoveVertexColors();
|
API_FUNCTION() void RemoveVertexColors();
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
|
||||||
void OnModelChanged();
|
void OnModelChanged();
|
||||||
void OnModelLoaded();
|
void OnModelLoaded();
|
||||||
void OnModelResidencyChanged();
|
void OnModelResidencyChanged();
|
||||||
void UpdateBounds();
|
void UpdateBounds();
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
|
||||||
// [ModelInstanceActor]
|
// [ModelInstanceActor]
|
||||||
bool HasContentLoaded() const override;
|
bool HasContentLoaded() const override;
|
||||||
void Draw(RenderContext& renderContext) override;
|
void Draw(RenderContext& renderContext) override;
|
||||||
@@ -198,7 +193,6 @@ public:
|
|||||||
bool IntersectsEntry(const Ray& ray, Real& distance, Vector3& normal, int32& entryIndex) override;
|
bool IntersectsEntry(const Ray& ray, Real& distance, Vector3& normal, int32& entryIndex) override;
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
|
|
||||||
// [ModelInstanceActor]
|
// [ModelInstanceActor]
|
||||||
void OnTransformChanged() override;
|
void OnTransformChanged() override;
|
||||||
void OnEnable() override;
|
void OnEnable() override;
|
||||||
|
|||||||
@@ -12,13 +12,11 @@
|
|||||||
class ActorsCache
|
class ActorsCache
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
|
|
||||||
typedef ActorsLookup ActorsLookupType;
|
typedef ActorsLookup ActorsLookupType;
|
||||||
typedef Array<Actor*> ActorsListType;
|
typedef Array<Actor*> ActorsListType;
|
||||||
typedef Array<SceneObject*> SceneObjectsListType;
|
typedef Array<SceneObject*> SceneObjectsListType;
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Gets the actors lookup cached. Safe allocation, per thread, uses caching.
|
/// Gets the actors lookup cached. Safe allocation, per thread, uses caching.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
|||||||
@@ -59,7 +59,6 @@ enum class SceneEventType
|
|||||||
class SceneAction
|
class SceneAction
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
|
|
||||||
virtual ~SceneAction()
|
virtual ~SceneAction()
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
@@ -113,7 +112,6 @@ using namespace LevelImpl;
|
|||||||
class LevelService : public EngineService
|
class LevelService : public EngineService
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
|
|
||||||
LevelService()
|
LevelService()
|
||||||
: EngineService(TEXT("Scene Manager"), 30)
|
: EngineService(TEXT("Scene Manager"), 30)
|
||||||
{
|
{
|
||||||
@@ -401,7 +399,6 @@ void Level::CollectPostFxVolumes(RenderContext& renderContext)
|
|||||||
class LoadSceneAction : public SceneAction
|
class LoadSceneAction : public SceneAction
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
|
|
||||||
Guid SceneId;
|
Guid SceneId;
|
||||||
AssetReference<JsonAsset> SceneAsset;
|
AssetReference<JsonAsset> SceneAsset;
|
||||||
|
|
||||||
@@ -444,7 +441,6 @@ public:
|
|||||||
class UnloadSceneAction : public SceneAction
|
class UnloadSceneAction : public SceneAction
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
|
|
||||||
Guid TargetScene;
|
Guid TargetScene;
|
||||||
|
|
||||||
UnloadSceneAction(Scene* scene)
|
UnloadSceneAction(Scene* scene)
|
||||||
@@ -464,7 +460,6 @@ public:
|
|||||||
class UnloadScenesAction : public SceneAction
|
class UnloadScenesAction : public SceneAction
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
|
|
||||||
UnloadScenesAction()
|
UnloadScenesAction()
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
@@ -478,7 +473,6 @@ public:
|
|||||||
class SaveSceneAction : public SceneAction
|
class SaveSceneAction : public SceneAction
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
|
|
||||||
Scene* TargetScene;
|
Scene* TargetScene;
|
||||||
bool PrettyJson;
|
bool PrettyJson;
|
||||||
|
|
||||||
@@ -504,7 +498,6 @@ public:
|
|||||||
class ReloadScriptsAction : public SceneAction
|
class ReloadScriptsAction : public SceneAction
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
|
|
||||||
ReloadScriptsAction()
|
ReloadScriptsAction()
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
@@ -655,7 +648,6 @@ void Level::ScriptsReloadRegisterObject(ScriptingObject*& obj)
|
|||||||
class SpawnActorAction : public SceneAction
|
class SpawnActorAction : public SceneAction
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
|
|
||||||
ScriptingObjectReference<Actor> TargetActor;
|
ScriptingObjectReference<Actor> TargetActor;
|
||||||
ScriptingObjectReference<Actor> ParentActor;
|
ScriptingObjectReference<Actor> ParentActor;
|
||||||
|
|
||||||
@@ -674,7 +666,6 @@ public:
|
|||||||
class DeleteActorAction : public SceneAction
|
class DeleteActorAction : public SceneAction
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
|
|
||||||
ScriptingObjectReference<Actor> TargetActor;
|
ScriptingObjectReference<Actor> TargetActor;
|
||||||
|
|
||||||
DeleteActorAction(Actor* actor)
|
DeleteActorAction(Actor* actor)
|
||||||
|
|||||||
@@ -21,7 +21,7 @@ struct RenderContext;
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
API_CLASS(Static) class FLAXENGINE_API Level
|
API_CLASS(Static) class FLAXENGINE_API Level
|
||||||
{
|
{
|
||||||
DECLARE_SCRIPTING_TYPE_NO_SPAWN(Level);
|
DECLARE_SCRIPTING_TYPE_NO_SPAWN(Level);
|
||||||
friend Engine;
|
friend Engine;
|
||||||
friend Actor;
|
friend Actor;
|
||||||
friend PrefabManager;
|
friend PrefabManager;
|
||||||
@@ -33,7 +33,6 @@ DECLARE_SCRIPTING_TYPE_NO_SPAWN(Level);
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// The scenes collection lock.
|
/// The scenes collection lock.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
@@ -45,7 +44,6 @@ public:
|
|||||||
API_FIELD(ReadOnly) static Array<Scene*> Scenes;
|
API_FIELD(ReadOnly) static Array<Scene*> Scenes;
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Occurs when new actor gets spawned to the game.
|
/// Occurs when new actor gets spawned to the game.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
@@ -77,7 +75,6 @@ public:
|
|||||||
API_EVENT() static Delegate<Actor*> ActorActiveChanged;
|
API_EVENT() static Delegate<Actor*> ActorActiveChanged;
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Checks if any scene has been loaded. Loaded scene means deserialized and added to the scenes collection.
|
/// Checks if any scene has been loaded. Loaded scene means deserialized and added to the scenes collection.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
@@ -124,7 +121,6 @@ public:
|
|||||||
}
|
}
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Spawn actor on the scene
|
/// Spawn actor on the scene
|
||||||
/// </summary>
|
/// </summary>
|
||||||
@@ -160,7 +156,6 @@ public:
|
|||||||
static void CallBeginPlay(Actor* obj);
|
static void CallBeginPlay(Actor* obj);
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Draws all the actors.
|
/// Draws all the actors.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
@@ -174,7 +169,6 @@ public:
|
|||||||
static void CollectPostFxVolumes(RenderContext& renderContext);
|
static void CollectPostFxVolumes(RenderContext& renderContext);
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Fired when scene starts saving.
|
/// Fired when scene starts saving.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
@@ -246,7 +240,6 @@ public:
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Saves scene to the asset.
|
/// Saves scene to the asset.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
@@ -342,7 +335,6 @@ public:
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Tries to find actor with the given ID. It's very fast O(1) lookup.
|
/// Tries to find actor with the given ID. It's very fast O(1) lookup.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
@@ -413,7 +405,6 @@ public:
|
|||||||
API_FUNCTION() static Scene* FindScene(const Guid& id);
|
API_FUNCTION() static Scene* FindScene(const Guid& id);
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Gets the scenes.
|
/// Gets the scenes.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
@@ -433,7 +424,6 @@ public:
|
|||||||
static void GetScenes(Array<Guid>& scenes);
|
static void GetScenes(Array<Guid>& scenes);
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Construct valid and solid list with actors from input list with whole tree for them (valid for fast serialization)
|
/// Construct valid and solid list with actors from input list with whole tree for them (valid for fast serialization)
|
||||||
/// </summary>
|
/// </summary>
|
||||||
@@ -449,7 +439,6 @@ public:
|
|||||||
static void ConstructParentActorsTreeList(const Array<Actor*>& input, Array<Actor*>& output);
|
static void ConstructParentActorsTreeList(const Array<Actor*>& input, Array<Actor*>& output);
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// The tags names.
|
/// The tags names.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
@@ -479,7 +468,6 @@ public:
|
|||||||
API_FUNCTION() static int32 GetLayerIndex(const StringView& layer);
|
API_FUNCTION() static int32 GetLayerIndex(const StringView& layer);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
|
||||||
// Actor API
|
// Actor API
|
||||||
enum class ActorEventType
|
enum class ActorEventType
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -14,7 +14,6 @@ class SceneLightmapsData;
|
|||||||
class Lightmap
|
class Lightmap
|
||||||
{
|
{
|
||||||
private:
|
private:
|
||||||
|
|
||||||
SceneLightmapsData* _manager;
|
SceneLightmapsData* _manager;
|
||||||
int32 _index;
|
int32 _index;
|
||||||
#if USE_EDITOR
|
#if USE_EDITOR
|
||||||
@@ -23,7 +22,6 @@ private:
|
|||||||
AssetReference<Texture> _textures[3];
|
AssetReference<Texture> _textures[3];
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Initializes a new instance of the <see cref="Lightmap"/> class.
|
/// Initializes a new instance of the <see cref="Lightmap"/> class.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
@@ -33,7 +31,6 @@ public:
|
|||||||
Lightmap(SceneLightmapsData* manager, int32 index, const SavedLightmapInfo& info);
|
Lightmap(SceneLightmapsData* manager, int32 index, const SavedLightmapInfo& info);
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Gets attached texture objects
|
/// Gets attached texture objects
|
||||||
/// </summary>
|
/// </summary>
|
||||||
@@ -99,7 +96,6 @@ public:
|
|||||||
bool IsReady() const;
|
bool IsReady() const;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
|
||||||
#if USE_EDITOR
|
#if USE_EDITOR
|
||||||
bool OnInitLightmap(class TextureData& image);
|
bool OnInitLightmap(class TextureData& image);
|
||||||
#endif
|
#endif
|
||||||
|
|||||||
@@ -19,7 +19,7 @@ API_CLASS() class FLAXENGINE_API Scene : public Actor
|
|||||||
{
|
{
|
||||||
friend class Level;
|
friend class Level;
|
||||||
friend class ReloadScriptsAction;
|
friend class ReloadScriptsAction;
|
||||||
DECLARE_SCENE_OBJECT(Scene);
|
DECLARE_SCENE_OBJECT(Scene);
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Finalizes an instance of the <see cref="Scene"/> class.
|
/// Finalizes an instance of the <see cref="Scene"/> class.
|
||||||
@@ -27,7 +27,6 @@ DECLARE_SCENE_OBJECT(Scene);
|
|||||||
~Scene();
|
~Scene();
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// The scene metadata.
|
/// The scene metadata.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
@@ -80,7 +79,6 @@ public:
|
|||||||
API_PROPERTY() void SetLightmapSettings(const LightmapSettings& value);
|
API_PROPERTY() void SetLightmapSettings(const LightmapSettings& value);
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Removes all baked lightmap textures from the scene.
|
/// Removes all baked lightmap textures from the scene.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
@@ -120,7 +118,6 @@ public:
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
|
||||||
MeshCollider* TryGetCsgCollider();
|
MeshCollider* TryGetCsgCollider();
|
||||||
StaticModel* TryGetCsgModel();
|
StaticModel* TryGetCsgModel();
|
||||||
void CreateCsgCollider();
|
void CreateCsgCollider();
|
||||||
@@ -132,7 +129,6 @@ private:
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
|
||||||
// [Actor]
|
// [Actor]
|
||||||
void Serialize(SerializeStream& stream, const void* otherObj) override;
|
void Serialize(SerializeStream& stream, const void* otherObj) override;
|
||||||
void Deserialize(DeserializeStream& stream, ISerializeModifier* modifier) override;
|
void Deserialize(DeserializeStream& stream, ISerializeModifier* modifier) override;
|
||||||
@@ -140,7 +136,6 @@ public:
|
|||||||
void EndPlay() override;
|
void EndPlay() override;
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
|
|
||||||
// [Actor]
|
// [Actor]
|
||||||
void PostLoad() override;
|
void PostLoad() override;
|
||||||
void PostSpawn() override;
|
void PostSpawn() override;
|
||||||
|
|||||||
@@ -9,7 +9,7 @@
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
API_CLASS(NoSpawn) class SceneAsset : public JsonAsset
|
API_CLASS(NoSpawn) class SceneAsset : public JsonAsset
|
||||||
{
|
{
|
||||||
DECLARE_ASSET_HEADER(SceneAsset);
|
DECLARE_ASSET_HEADER(SceneAsset);
|
||||||
protected:
|
protected:
|
||||||
bool IsInternalType() const override;
|
bool IsInternalType() const override;
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -20,11 +20,9 @@ namespace CSG
|
|||||||
class SceneCSGData : public ISerializable
|
class SceneCSGData : public ISerializable
|
||||||
{
|
{
|
||||||
private:
|
private:
|
||||||
|
|
||||||
Scene* _scene;
|
Scene* _scene;
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Initializes a new instance of the <see cref="SceneCSGData"/> class.
|
/// Initializes a new instance of the <see cref="SceneCSGData"/> class.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
@@ -32,7 +30,6 @@ namespace CSG
|
|||||||
SceneCSGData(Scene* scene);
|
SceneCSGData(Scene* scene);
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// CSG mesh building action time (registered by CSG::Builder, in UTC format). Invalid if not build by active engine instance.
|
/// CSG mesh building action time (registered by CSG::Builder, in UTC format). Invalid if not build by active engine instance.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
@@ -64,7 +61,6 @@ namespace CSG
|
|||||||
Action PostCSGBuild;
|
Action PostCSGBuild;
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Build CSG geometry for the given scene.
|
/// Build CSG geometry for the given scene.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
@@ -77,7 +73,6 @@ namespace CSG
|
|||||||
bool HasData() const;
|
bool HasData() const;
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
|
||||||
struct SurfaceData
|
struct SurfaceData
|
||||||
{
|
{
|
||||||
Array<Triangle> Triangles;
|
Array<Triangle> Triangles;
|
||||||
@@ -95,11 +90,9 @@ namespace CSG
|
|||||||
bool TryGetSurfaceData(const Guid& brushId, int32 brushSurfaceIndex, SurfaceData& outData);
|
bool TryGetSurfaceData(const Guid& brushId, int32 brushSurfaceIndex, SurfaceData& outData);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
|
||||||
void OnDataChanged();
|
void OnDataChanged();
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
|
||||||
// [ISerializable]
|
// [ISerializable]
|
||||||
void Serialize(SerializeStream& stream, const void* otherObj) override;
|
void Serialize(SerializeStream& stream, const void* otherObj) override;
|
||||||
void Deserialize(DeserializeStream& stream, ISerializeModifier* modifier) override;
|
void Deserialize(DeserializeStream& stream, ISerializeModifier* modifier) override;
|
||||||
|
|||||||
@@ -13,12 +13,10 @@ class Lightmap;
|
|||||||
class SceneLightmapsData
|
class SceneLightmapsData
|
||||||
{
|
{
|
||||||
private:
|
private:
|
||||||
|
|
||||||
Array<Lightmap*> _lightmaps;
|
Array<Lightmap*> _lightmaps;
|
||||||
Scene* _scene;
|
Scene* _scene;
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Initializes a new instance of the <see cref="StaticLightManager"/> class.
|
/// Initializes a new instance of the <see cref="StaticLightManager"/> class.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
@@ -31,7 +29,6 @@ public:
|
|||||||
~SceneLightmapsData();
|
~SceneLightmapsData();
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
|
||||||
FORCE_INLINE Scene* GetScene() const
|
FORCE_INLINE Scene* GetScene() const
|
||||||
{
|
{
|
||||||
return _scene;
|
return _scene;
|
||||||
@@ -64,7 +61,6 @@ public:
|
|||||||
}
|
}
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
|
||||||
#if USE_EDITOR
|
#if USE_EDITOR
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
@@ -84,7 +80,6 @@ public:
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Clear baked lightmaps data
|
/// Clear baked lightmaps data
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
|||||||
@@ -13,7 +13,6 @@ class NavMeshBoundsVolume;
|
|||||||
class FLAXENGINE_API SceneNavigation
|
class FLAXENGINE_API SceneNavigation
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// The list of registered navigation bounds volumes (on the scene).
|
/// The list of registered navigation bounds volumes (on the scene).
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
|||||||
@@ -11,7 +11,6 @@
|
|||||||
class FLAXENGINE_API SceneTicking
|
class FLAXENGINE_API SceneTicking
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Tick function type.
|
/// Tick function type.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
@@ -48,7 +47,6 @@ public:
|
|||||||
class FLAXENGINE_API TickData
|
class FLAXENGINE_API TickData
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
|
|
||||||
Array<Script*> Scripts;
|
Array<Script*> Scripts;
|
||||||
Array<Tick> Ticks;
|
Array<Tick> Ticks;
|
||||||
#if USE_EDITOR
|
#if USE_EDITOR
|
||||||
@@ -93,7 +91,6 @@ public:
|
|||||||
class FLAXENGINE_API FixedUpdateTickData : public TickData
|
class FLAXENGINE_API FixedUpdateTickData : public TickData
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
|
|
||||||
FixedUpdateTickData();
|
FixedUpdateTickData();
|
||||||
void TickScripts(const Array<Script*>& scripts) override;
|
void TickScripts(const Array<Script*>& scripts) override;
|
||||||
};
|
};
|
||||||
@@ -101,7 +98,6 @@ public:
|
|||||||
class FLAXENGINE_API UpdateTickData : public TickData
|
class FLAXENGINE_API UpdateTickData : public TickData
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
|
|
||||||
UpdateTickData();
|
UpdateTickData();
|
||||||
void TickScripts(const Array<Script*>& scripts) override;
|
void TickScripts(const Array<Script*>& scripts) override;
|
||||||
};
|
};
|
||||||
@@ -109,13 +105,11 @@ public:
|
|||||||
class FLAXENGINE_API LateUpdateTickData : public TickData
|
class FLAXENGINE_API LateUpdateTickData : public TickData
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
|
|
||||||
LateUpdateTickData();
|
LateUpdateTickData();
|
||||||
void TickScripts(const Array<Script*>& scripts) override;
|
void TickScripts(const Array<Script*>& scripts) override;
|
||||||
};
|
};
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Adds the script to scene ticking system.
|
/// Adds the script to scene ticking system.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
@@ -134,7 +128,6 @@ public:
|
|||||||
void Clear();
|
void Clear();
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// The fixed update tick function.
|
/// The fixed update tick function.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
|||||||
@@ -14,7 +14,6 @@
|
|||||||
class SceneInfo : public Object, public ISerializable
|
class SceneInfo : public Object, public ISerializable
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Scene title
|
/// Scene title
|
||||||
/// </summary>
|
/// </summary>
|
||||||
@@ -31,7 +30,6 @@ public:
|
|||||||
String Copyright;
|
String Copyright;
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Array with cached lightmaps ID for the scene
|
/// Array with cached lightmaps ID for the scene
|
||||||
/// </summary>
|
/// </summary>
|
||||||
@@ -43,7 +41,6 @@ public:
|
|||||||
LightmapSettings LightmapSettings;
|
LightmapSettings LightmapSettings;
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
|
||||||
// [Object]
|
// [Object]
|
||||||
String ToString() const override;
|
String ToString() const override;
|
||||||
|
|
||||||
|
|||||||
@@ -24,7 +24,6 @@ class Level;
|
|||||||
class SceneBeginData
|
class SceneBeginData
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// The joints to create after setup.
|
/// The joints to create after setup.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
@@ -57,7 +56,7 @@ typedef Dictionary<Guid, Actor*, HeapAllocation> ActorsLookup;
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
API_CLASS(Abstract, NoSpawn) class FLAXENGINE_API SceneObject : public ScriptingObject, public ISerializable
|
API_CLASS(Abstract, NoSpawn) class FLAXENGINE_API SceneObject : public ScriptingObject, public ISerializable
|
||||||
{
|
{
|
||||||
DECLARE_SCRIPTING_TYPE_NO_SPAWN(SceneObject);
|
DECLARE_SCRIPTING_TYPE_NO_SPAWN(SceneObject);
|
||||||
friend PrefabInstanceData;
|
friend PrefabInstanceData;
|
||||||
friend Actor;
|
friend Actor;
|
||||||
friend Level;
|
friend Level;
|
||||||
@@ -78,7 +77,6 @@ public:
|
|||||||
// - Destroy
|
// - Destroy
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
|
|
||||||
Actor* _parent;
|
Actor* _parent;
|
||||||
Guid _prefabID;
|
Guid _prefabID;
|
||||||
Guid _prefabObjectID;
|
Guid _prefabObjectID;
|
||||||
@@ -90,14 +88,12 @@ protected:
|
|||||||
SceneObject(const SpawnParams& params);
|
SceneObject(const SpawnParams& params);
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Finalizes an instance of the <see cref="SceneObject"/> class.
|
/// Finalizes an instance of the <see cref="SceneObject"/> class.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
~SceneObject();
|
~SceneObject();
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Determines whether object is during play (spawned/loaded and fully initialized).
|
/// Determines whether object is during play (spawned/loaded and fully initialized).
|
||||||
/// </summary>
|
/// </summary>
|
||||||
@@ -162,7 +158,6 @@ public:
|
|||||||
API_PROPERTY() virtual void SetOrderInParent(int32 index) = 0;
|
API_PROPERTY() virtual void SetOrderInParent(int32 index) = 0;
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Gets a value indicating whether this object has a valid linkage to the prefab asset.
|
/// Gets a value indicating whether this object has a valid linkage to the prefab asset.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
@@ -211,7 +206,6 @@ public:
|
|||||||
API_FUNCTION() String GetNamePath(Char separatorChar = '/') const;
|
API_FUNCTION() String GetNamePath(Char separatorChar = '/') const;
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Called after whole scene or local group of scene objects deserialization.
|
/// Called after whole scene or local group of scene objects deserialization.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
@@ -234,7 +228,6 @@ public:
|
|||||||
virtual void EndPlay() = 0;
|
virtual void EndPlay() = 0;
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
|
||||||
// [ISerializable]
|
// [ISerializable]
|
||||||
void Serialize(SerializeStream& stream, const void* otherObj) override;
|
void Serialize(SerializeStream& stream, const void* otherObj) override;
|
||||||
void Deserialize(DeserializeStream& stream, ISerializeModifier* modifier) override;
|
void Deserialize(DeserializeStream& stream, ISerializeModifier* modifier) override;
|
||||||
|
|||||||
@@ -11,7 +11,6 @@
|
|||||||
class FLAXENGINE_API SceneObjectsFactory
|
class FLAXENGINE_API SceneObjectsFactory
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
|
|
||||||
struct PrefabInstance
|
struct PrefabInstance
|
||||||
{
|
{
|
||||||
Guid RootId;
|
Guid RootId;
|
||||||
@@ -60,7 +59,6 @@ public:
|
|||||||
static Actor* CreateActor(int32 typeId, const Guid& id);
|
static Actor* CreateActor(int32 typeId, const Guid& id);
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
|
||||||
struct PrefabSyncData
|
struct PrefabSyncData
|
||||||
{
|
{
|
||||||
friend SceneObjectsFactory;
|
friend SceneObjectsFactory;
|
||||||
@@ -117,6 +115,5 @@ public:
|
|||||||
static void SynchronizePrefabInstances(Context& context, PrefabSyncData& data);
|
static void SynchronizePrefabInstances(Context& context, PrefabSyncData& data);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
|
||||||
static void SynchronizeNewPrefabInstance(Context& context, PrefabSyncData& data, Prefab* prefab, Actor* actor, const Guid& prefabObjectId);
|
static void SynchronizeNewPrefabInstance(Context& context, PrefabSyncData& data, Prefab* prefab, Actor* actor, const Guid& prefabObjectId);
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -9,7 +9,7 @@ Actor* SceneQuery::RaycastScene(const Ray& ray)
|
|||||||
PROFILE_CPU();
|
PROFILE_CPU();
|
||||||
|
|
||||||
#if SCENE_QUERIES_WITH_LOCK
|
#if SCENE_QUERIES_WITH_LOCK
|
||||||
ScopeLock lock(Level::ScenesLock);
|
ScopeLock lock(Level::ScenesLock);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
Actor* target;
|
Actor* target;
|
||||||
@@ -94,7 +94,7 @@ void SceneQuery::GetAllActors(Array<Actor*>& actors)
|
|||||||
PROFILE_CPU();
|
PROFILE_CPU();
|
||||||
|
|
||||||
#if SCENE_QUERIES_WITH_LOCK
|
#if SCENE_QUERIES_WITH_LOCK
|
||||||
ScopeLock lock(Level::ScenesLock);
|
ScopeLock lock(Level::ScenesLock);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
for (int32 i = 0; i < Level::Scenes.Count(); i++)
|
for (int32 i = 0; i < Level::Scenes.Count(); i++)
|
||||||
|
|||||||
@@ -17,7 +17,6 @@
|
|||||||
class FLAXENGINE_API SceneQuery
|
class FLAXENGINE_API SceneQuery
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Try to find actor hit by the given ray
|
/// Try to find actor hit by the given ray
|
||||||
/// </summary>
|
/// </summary>
|
||||||
@@ -26,7 +25,6 @@ public:
|
|||||||
static Actor* RaycastScene(const Ray& ray);
|
static Actor* RaycastScene(const Ray& ray);
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Gets all scene objects from the actor into linear list. Appends them (without the given actor).
|
/// Gets all scene objects from the actor into linear list. Appends them (without the given actor).
|
||||||
/// </summary>
|
/// </summary>
|
||||||
@@ -55,7 +53,6 @@ public:
|
|||||||
static void GetAllActors(Array<Actor*>& actors);
|
static void GetAllActors(Array<Actor*>& actors);
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Execute custom action on actors tree.
|
/// Execute custom action on actors tree.
|
||||||
/// Action should returns false to stop calling deeper.
|
/// Action should returns false to stop calling deeper.
|
||||||
@@ -67,7 +64,7 @@ public:
|
|||||||
static void TreeExecute(Function<bool(Actor*, Params ...)>& action, Params ... args)
|
static void TreeExecute(Function<bool(Actor*, Params ...)>& action, Params ... args)
|
||||||
{
|
{
|
||||||
#if SCENE_QUERIES_WITH_LOCK
|
#if SCENE_QUERIES_WITH_LOCK
|
||||||
ScopeLock lock(Level::ScenesLock);
|
ScopeLock lock(Level::ScenesLock);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
for (int32 i = 0; i < Level::Scenes.Count(); i++)
|
for (int32 i = 0; i < Level::Scenes.Count(); i++)
|
||||||
|
|||||||
@@ -12,9 +12,8 @@
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
API_CLASS() class FLAXENGINE_API SpriteRender : public Actor
|
API_CLASS() class FLAXENGINE_API SpriteRender : public Actor
|
||||||
{
|
{
|
||||||
DECLARE_SCENE_OBJECT(SpriteRender);
|
DECLARE_SCENE_OBJECT(SpriteRender);
|
||||||
private:
|
private:
|
||||||
|
|
||||||
Color _color;
|
Color _color;
|
||||||
Float2 _size;
|
Float2 _size;
|
||||||
SpriteHandle _sprite;
|
SpriteHandle _sprite;
|
||||||
@@ -26,7 +25,6 @@ private:
|
|||||||
int32 _sceneRenderingKey = -1;
|
int32 _sceneRenderingKey = -1;
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Gets the size of the sprite.
|
/// Gets the size of the sprite.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
@@ -86,12 +84,10 @@ public:
|
|||||||
DrawPass DrawModes = DrawPass::Default;
|
DrawPass DrawModes = DrawPass::Default;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
|
||||||
void OnMaterialLoaded();
|
void OnMaterialLoaded();
|
||||||
void SetImage();
|
void SetImage();
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
|
||||||
// [Actor]
|
// [Actor]
|
||||||
bool HasContentLoaded() const override;
|
bool HasContentLoaded() const override;
|
||||||
void Draw(RenderContext& renderContext) override;
|
void Draw(RenderContext& renderContext) override;
|
||||||
@@ -101,7 +97,6 @@ public:
|
|||||||
void OnEndPlay() override;
|
void OnEndPlay() override;
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
|
|
||||||
// [Actor]
|
// [Actor]
|
||||||
void OnEnable() override;
|
void OnEnable() override;
|
||||||
void OnDisable() override;
|
void OnDisable() override;
|
||||||
|
|||||||
@@ -21,9 +21,8 @@
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
API_CLASS() class FLAXENGINE_API TextRender : public Actor
|
API_CLASS() class FLAXENGINE_API TextRender : public Actor
|
||||||
{
|
{
|
||||||
DECLARE_SCENE_OBJECT(TextRender);
|
DECLARE_SCENE_OBJECT(TextRender);
|
||||||
private:
|
private:
|
||||||
|
|
||||||
struct DrawChunk
|
struct DrawChunk
|
||||||
{
|
{
|
||||||
TextRender* Actor;
|
TextRender* Actor;
|
||||||
@@ -55,7 +54,6 @@ private:
|
|||||||
Array<DrawChunk, InlinedAllocation<8>> _drawChunks;
|
Array<DrawChunk, InlinedAllocation<8>> _drawChunks;
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Gets the text.
|
/// Gets the text.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
@@ -154,7 +152,6 @@ public:
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
|
||||||
void Invalidate()
|
void Invalidate()
|
||||||
{
|
{
|
||||||
// Invalidate data
|
// Invalidate data
|
||||||
@@ -162,7 +159,6 @@ private:
|
|||||||
}
|
}
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
|
||||||
// [Actor]
|
// [Actor]
|
||||||
bool HasContentLoaded() const override;
|
bool HasContentLoaded() const override;
|
||||||
void Draw(RenderContext& renderContext) override;
|
void Draw(RenderContext& renderContext) override;
|
||||||
@@ -175,7 +171,6 @@ public:
|
|||||||
void Deserialize(DeserializeStream& stream, ISerializeModifier* modifier) override;
|
void Deserialize(DeserializeStream& stream, ISerializeModifier* modifier) override;
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
|
|
||||||
// [Actor]
|
// [Actor]
|
||||||
void OnEnable() override;
|
void OnEnable() override;
|
||||||
void OnDisable() override;
|
void OnDisable() override;
|
||||||
|
|||||||
@@ -9,9 +9,8 @@
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
API_CLASS(Sealed, NoConstructor) class FLAXENGINE_API UICanvas : public Actor
|
API_CLASS(Sealed, NoConstructor) class FLAXENGINE_API UICanvas : public Actor
|
||||||
{
|
{
|
||||||
DECLARE_SCENE_OBJECT(UICanvas);
|
DECLARE_SCENE_OBJECT(UICanvas);
|
||||||
public:
|
public:
|
||||||
|
|
||||||
// [Actor]
|
// [Actor]
|
||||||
#if USE_EDITOR
|
#if USE_EDITOR
|
||||||
BoundingBox GetEditorBox() const override;
|
BoundingBox GetEditorBox() const override;
|
||||||
@@ -20,7 +19,6 @@ public:
|
|||||||
void Deserialize(DeserializeStream& stream, ISerializeModifier* modifier) override;
|
void Deserialize(DeserializeStream& stream, ISerializeModifier* modifier) override;
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
|
|
||||||
// [Actor]
|
// [Actor]
|
||||||
void BeginPlay(SceneBeginData* data) final override;
|
void BeginPlay(SceneBeginData* data) final override;
|
||||||
void EndPlay() final override;
|
void EndPlay() final override;
|
||||||
|
|||||||
@@ -9,7 +9,6 @@
|
|||||||
class Crc
|
class Crc
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
|
|
||||||
// Helper lookup table with cached CRC values.
|
// Helper lookup table with cached CRC values.
|
||||||
static uint32 CachedCRCTablesSB8[8][256];
|
static uint32 CachedCRCTablesSB8[8][256];
|
||||||
|
|
||||||
|
|||||||
@@ -12,7 +12,6 @@
|
|||||||
class Delaunay2D
|
class Delaunay2D
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
|
|
||||||
struct Triangle
|
struct Triangle
|
||||||
{
|
{
|
||||||
int32 Indices[3];
|
int32 Indices[3];
|
||||||
@@ -125,7 +124,6 @@ public:
|
|||||||
}
|
}
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
|
||||||
struct Edge
|
struct Edge
|
||||||
{
|
{
|
||||||
int32 Indices[2];
|
int32 Indices[2];
|
||||||
|
|||||||
@@ -10,7 +10,6 @@
|
|||||||
class FLAXENGINE_API Encryption
|
class FLAXENGINE_API Encryption
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Encrypt bytes with custom data
|
/// Encrypt bytes with custom data
|
||||||
/// </summary>
|
/// </summary>
|
||||||
@@ -26,7 +25,6 @@ public:
|
|||||||
static void DecryptBytes(byte* data, uint64 size);
|
static void DecryptBytes(byte* data, uint64 size);
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
|
||||||
static int32 Base64EncodeLength(int32 size);
|
static int32 Base64EncodeLength(int32 size);
|
||||||
static int32 Base64DecodeLength(const char* encoded, int32 length);
|
static int32 Base64DecodeLength(const char* encoded, int32 length);
|
||||||
static void Base64Encode(const byte* bytes, int32 size, Array<char>& encoded);
|
static void Base64Encode(const byte* bytes, int32 size, Array<char>& encoded);
|
||||||
|
|||||||
@@ -24,7 +24,6 @@ class CaptureScreenshot : public ThreadPoolTask
|
|||||||
{
|
{
|
||||||
friend Screenshot;
|
friend Screenshot;
|
||||||
private:
|
private:
|
||||||
|
|
||||||
TextureData _data;
|
TextureData _data;
|
||||||
GPUTextureReference _texture;
|
GPUTextureReference _texture;
|
||||||
ScriptingObjectReference<RenderTask> _renderTask;
|
ScriptingObjectReference<RenderTask> _renderTask;
|
||||||
@@ -32,7 +31,6 @@ private:
|
|||||||
DateTime _startTime;
|
DateTime _startTime;
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Initializes a new instance of the <see cref="CaptureScreenshot"/> class.
|
/// Initializes a new instance of the <see cref="CaptureScreenshot"/> class.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
@@ -60,7 +58,6 @@ public:
|
|||||||
}
|
}
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Gets the texture data container.
|
/// Gets the texture data container.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
@@ -71,7 +68,6 @@ public:
|
|||||||
}
|
}
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
|
|
||||||
// [ThreadPoolTask]
|
// [ThreadPoolTask]
|
||||||
bool Run() override;
|
bool Run() override;
|
||||||
void OnFail() override;
|
void OnFail() override;
|
||||||
|
|||||||
@@ -14,7 +14,7 @@ class GPUTexture;
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
API_CLASS(Static) class FLAXENGINE_API Screenshot
|
API_CLASS(Static) class FLAXENGINE_API Screenshot
|
||||||
{
|
{
|
||||||
DECLARE_SCRIPTING_TYPE_NO_SPAWN(Screenshot);
|
DECLARE_SCRIPTING_TYPE_NO_SPAWN(Screenshot);
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Captures the specified render target contents and saves it to the file.
|
/// Captures the specified render target contents and saves it to the file.
|
||||||
|
|||||||
@@ -14,11 +14,9 @@ class FLAXENGINE_API State
|
|||||||
friend StateMachine;
|
friend StateMachine;
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
|
|
||||||
StateMachine* _parent;
|
StateMachine* _parent;
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Init
|
/// Init
|
||||||
/// </summary>
|
/// </summary>
|
||||||
@@ -31,7 +29,6 @@ protected:
|
|||||||
~State();
|
~State();
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// State's activity
|
/// State's activity
|
||||||
/// </summary>
|
/// </summary>
|
||||||
@@ -58,7 +55,6 @@ public:
|
|||||||
}
|
}
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
|
|
||||||
virtual void enterState()
|
virtual void enterState()
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
@@ -76,12 +72,10 @@ class FLAXENGINE_API StateMachine
|
|||||||
friend State;
|
friend State;
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
|
|
||||||
State* _currentState;
|
State* _currentState;
|
||||||
Array<State*> _states;
|
Array<State*> _states;
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Init
|
/// Init
|
||||||
/// </summary>
|
/// </summary>
|
||||||
@@ -93,7 +87,6 @@ public:
|
|||||||
virtual ~StateMachine();
|
virtual ~StateMachine();
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Gets current state
|
/// Gets current state
|
||||||
/// </summary>
|
/// </summary>
|
||||||
@@ -113,7 +106,6 @@ public:
|
|||||||
}
|
}
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Go to state
|
/// Go to state
|
||||||
/// </summary>
|
/// </summary>
|
||||||
@@ -130,6 +122,5 @@ public:
|
|||||||
virtual void GoToState(State* state);
|
virtual void GoToState(State* state);
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
|
|
||||||
virtual void switchState(State* nextState);
|
virtual void switchState(State* nextState);
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -9,20 +9,17 @@ template<typename CharType, int InlinedSize = 128>
|
|||||||
class StringAsBase
|
class StringAsBase
|
||||||
{
|
{
|
||||||
protected:
|
protected:
|
||||||
|
|
||||||
const CharType* _static = nullptr;
|
const CharType* _static = nullptr;
|
||||||
CharType* _dynamic = nullptr;
|
CharType* _dynamic = nullptr;
|
||||||
CharType _inlined[InlinedSize];
|
CharType _inlined[InlinedSize];
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
|
||||||
~StringAsBase()
|
~StringAsBase()
|
||||||
{
|
{
|
||||||
Allocator::Free(_dynamic);
|
Allocator::Free(_dynamic);
|
||||||
}
|
}
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
|
||||||
const CharType* Get() const
|
const CharType* Get() const
|
||||||
{
|
{
|
||||||
return _static ? _static : (_dynamic ? _dynamic : _inlined);
|
return _static ? _static : (_dynamic ? _dynamic : _inlined);
|
||||||
@@ -38,12 +35,10 @@ template<int InlinedSize = 128>
|
|||||||
class StringAsANSI : public StringAsBase<char, InlinedSize>
|
class StringAsANSI : public StringAsBase<char, InlinedSize>
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
|
|
||||||
typedef char CharType;
|
typedef char CharType;
|
||||||
typedef StringAsBase<CharType, InlinedSize> Base;
|
typedef StringAsBase<CharType, InlinedSize> Base;
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
|
||||||
StringAsANSI(const char* text)
|
StringAsANSI(const char* text)
|
||||||
{
|
{
|
||||||
this->_static = text;
|
this->_static = text;
|
||||||
@@ -74,12 +69,10 @@ template<int InlinedSize = 128>
|
|||||||
class StringAsUTF8 : public StringAsBase<char, InlinedSize>
|
class StringAsUTF8 : public StringAsBase<char, InlinedSize>
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
|
|
||||||
typedef char CharType;
|
typedef char CharType;
|
||||||
typedef StringAsBase<CharType, InlinedSize> Base;
|
typedef StringAsBase<CharType, InlinedSize> Base;
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
|
||||||
StringAsUTF8(const char* text)
|
StringAsUTF8(const char* text)
|
||||||
{
|
{
|
||||||
this->_static = text;
|
this->_static = text;
|
||||||
@@ -110,12 +103,10 @@ template<int InlinedSize = 128>
|
|||||||
class StringAsUTF16 : public StringAsBase<Char, InlinedSize>
|
class StringAsUTF16 : public StringAsBase<Char, InlinedSize>
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
|
|
||||||
typedef Char CharType;
|
typedef Char CharType;
|
||||||
typedef StringAsBase<CharType, InlinedSize> Base;
|
typedef StringAsBase<CharType, InlinedSize> Base;
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
|
||||||
StringAsUTF16(const char* text)
|
StringAsUTF16(const char* text)
|
||||||
: StringAsUTF16(text, StringUtils::Length(text))
|
: StringAsUTF16(text, StringUtils::Length(text))
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -14,19 +14,16 @@
|
|||||||
class FLAXENGINE_API TextProcessing : public NonCopyable
|
class FLAXENGINE_API TextProcessing : public NonCopyable
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Separator structure
|
/// Separator structure
|
||||||
/// </summary>
|
/// </summary>
|
||||||
struct SeparatorData
|
struct SeparatorData
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
|
|
||||||
char C0;
|
char C0;
|
||||||
char C1;
|
char C1;
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
|
||||||
SeparatorData()
|
SeparatorData()
|
||||||
: C0(0)
|
: C0(0)
|
||||||
, C1(0)
|
, C1(0)
|
||||||
@@ -52,7 +49,6 @@ public:
|
|||||||
}
|
}
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
|
||||||
bool IsWhiteSpace() const
|
bool IsWhiteSpace() const
|
||||||
{
|
{
|
||||||
return *this == SeparatorData('\r', '\n')
|
return *this == SeparatorData('\r', '\n')
|
||||||
@@ -62,7 +58,6 @@ public:
|
|||||||
}
|
}
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
|
||||||
bool operator==(const SeparatorData& other) const
|
bool operator==(const SeparatorData& other) const
|
||||||
{
|
{
|
||||||
return C0 == other.C0 && C1 == other.C1;
|
return C0 == other.C0 && C1 == other.C1;
|
||||||
@@ -80,13 +75,11 @@ public:
|
|||||||
struct Token
|
struct Token
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
|
|
||||||
const char* Start;
|
const char* Start;
|
||||||
int32 Length;
|
int32 Length;
|
||||||
SeparatorData Separator;
|
SeparatorData Separator;
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
|
||||||
Token()
|
Token()
|
||||||
: Start(nullptr)
|
: Start(nullptr)
|
||||||
, Length(0)
|
, Length(0)
|
||||||
@@ -135,14 +128,12 @@ public:
|
|||||||
}*/
|
}*/
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
|
||||||
StringAnsi ToString() const
|
StringAnsi ToString() const
|
||||||
{
|
{
|
||||||
return StringAnsi(Start, Length);
|
return StringAnsi(Start, Length);
|
||||||
}
|
}
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
|
||||||
FORCE_INLINE bool Equals(const Token& other) const
|
FORCE_INLINE bool Equals(const Token& other) const
|
||||||
{
|
{
|
||||||
return Equals(other.Start, other.Length);
|
return Equals(other.Start, other.Length);
|
||||||
@@ -159,7 +150,6 @@ public:
|
|||||||
}
|
}
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
|
||||||
FORCE_INLINE bool EqualsIgnoreCase(const Token& other) const
|
FORCE_INLINE bool EqualsIgnoreCase(const Token& other) const
|
||||||
{
|
{
|
||||||
return EqualsIgnoreCase(other.Start, other.Length);
|
return EqualsIgnoreCase(other.Start, other.Length);
|
||||||
@@ -176,7 +166,6 @@ public:
|
|||||||
}
|
}
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
|
||||||
FORCE_INLINE bool operator==(const char* text) const
|
FORCE_INLINE bool operator==(const char* text) const
|
||||||
{
|
{
|
||||||
auto token = Token(text);
|
auto token = Token(text);
|
||||||
@@ -195,7 +184,6 @@ public:
|
|||||||
};
|
};
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
|
||||||
const char* _buffer;
|
const char* _buffer;
|
||||||
int32 _length;
|
int32 _length;
|
||||||
char* _cursor;
|
char* _cursor;
|
||||||
@@ -203,7 +191,6 @@ private:
|
|||||||
int32 _line;
|
int32 _line;
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Init
|
/// Init
|
||||||
/// </summary>
|
/// </summary>
|
||||||
@@ -212,7 +199,6 @@ public:
|
|||||||
TextProcessing(const char* input, int32 length);
|
TextProcessing(const char* input, int32 length);
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Array with all token separators
|
/// Array with all token separators
|
||||||
/// </summary>
|
/// </summary>
|
||||||
@@ -224,14 +210,12 @@ public:
|
|||||||
Array<char> Whitespaces;
|
Array<char> Whitespaces;
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Set separators and white chars for HLSL language
|
/// Set separators and white chars for HLSL language
|
||||||
/// </summary>
|
/// </summary>
|
||||||
void Setup_HLSL();
|
void Setup_HLSL();
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Returns true if there are still characters in the buffer and can read data from it
|
/// Returns true if there are still characters in the buffer and can read data from it
|
||||||
/// </summary>
|
/// </summary>
|
||||||
@@ -260,7 +244,6 @@ public:
|
|||||||
}
|
}
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Read single character from the buffer
|
/// Read single character from the buffer
|
||||||
/// </summary>
|
/// </summary>
|
||||||
@@ -290,7 +273,6 @@ public:
|
|||||||
void ReadLine();
|
void ReadLine();
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
|
||||||
char moveForward();
|
char moveForward();
|
||||||
char moveBack();
|
char moveBack();
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -15,11 +15,9 @@ template<typename CharType>
|
|||||||
class TextWriter : public Object, public NonCopyable
|
class TextWriter : public Object, public NonCopyable
|
||||||
{
|
{
|
||||||
private:
|
private:
|
||||||
|
|
||||||
MemoryWriteStream _buffer;
|
MemoryWriteStream _buffer;
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Init with default capacity
|
/// Init with default capacity
|
||||||
/// </summary>
|
/// </summary>
|
||||||
@@ -37,7 +35,6 @@ public:
|
|||||||
}
|
}
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Gets writer private buffer
|
/// Gets writer private buffer
|
||||||
/// </summary>
|
/// </summary>
|
||||||
@@ -57,7 +54,6 @@ public:
|
|||||||
}
|
}
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Write line terminator sign
|
/// Write line terminator sign
|
||||||
/// </summary>
|
/// </summary>
|
||||||
@@ -139,7 +135,6 @@ public:
|
|||||||
}
|
}
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Clear whole data
|
/// Clear whole data
|
||||||
/// </summary>
|
/// </summary>
|
||||||
@@ -149,7 +144,6 @@ public:
|
|||||||
}
|
}
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
|
||||||
// [Object]
|
// [Object]
|
||||||
String ToString() const override
|
String ToString() const override
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -23,14 +23,12 @@ template<class NodeType, class BoxType, class ParameterType>
|
|||||||
class Graph
|
class Graph
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
|
|
||||||
typedef Graph<NodeType, BoxType, ParameterType> GraphType;
|
typedef Graph<NodeType, BoxType, ParameterType> GraphType;
|
||||||
typedef NodeType Node;
|
typedef NodeType Node;
|
||||||
typedef BoxType Box;
|
typedef BoxType Box;
|
||||||
typedef ParameterType Parameter;
|
typedef ParameterType Parameter;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
|
||||||
struct TmpConnectionHint
|
struct TmpConnectionHint
|
||||||
{
|
{
|
||||||
Node* Node;
|
Node* Node;
|
||||||
@@ -56,7 +54,6 @@ public:
|
|||||||
VisjectMeta Meta;
|
VisjectMeta Meta;
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Initializes a new instance of the <see cref="Graph"/> class.
|
/// Initializes a new instance of the <see cref="Graph"/> class.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
@@ -72,7 +69,6 @@ public:
|
|||||||
}
|
}
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Save graph to the stream
|
/// Save graph to the stream
|
||||||
/// </summary>
|
/// </summary>
|
||||||
@@ -456,7 +452,6 @@ public:
|
|||||||
}
|
}
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Find node by ID
|
/// Find node by ID
|
||||||
/// </summary>
|
/// </summary>
|
||||||
@@ -528,7 +523,6 @@ public:
|
|||||||
}
|
}
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
|
||||||
#if USE_EDITOR
|
#if USE_EDITOR
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
@@ -561,7 +555,6 @@ public:
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
|
|
||||||
virtual bool onNodeCreated(Node* n)
|
virtual bool onNodeCreated(Node* n)
|
||||||
{
|
{
|
||||||
return false;
|
return false;
|
||||||
|
|||||||
@@ -19,7 +19,6 @@ class GraphNode;
|
|||||||
class GraphBox
|
class GraphBox
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// The parent node
|
/// The parent node
|
||||||
/// </summary>
|
/// </summary>
|
||||||
@@ -41,7 +40,6 @@ public:
|
|||||||
Array<GraphBox*, InlinedAllocation<4>> Connections;
|
Array<GraphBox*, InlinedAllocation<4>> Connections;
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
|
||||||
GraphBox()
|
GraphBox()
|
||||||
: Parent(nullptr)
|
: Parent(nullptr)
|
||||||
, ID(0)
|
, ID(0)
|
||||||
@@ -75,7 +73,6 @@ public:
|
|||||||
}
|
}
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Gets the parent node.
|
/// Gets the parent node.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
@@ -101,12 +98,10 @@ template<class BoxType>
|
|||||||
class GraphNode
|
class GraphNode
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
|
|
||||||
typedef BoxType Box;
|
typedef BoxType Box;
|
||||||
typedef GraphNode<BoxType> Node;
|
typedef GraphNode<BoxType> Node;
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Unique node ID (within a graph).
|
/// Unique node ID (within a graph).
|
||||||
/// </summary>
|
/// </summary>
|
||||||
@@ -139,7 +134,6 @@ public:
|
|||||||
VisjectMeta Meta;
|
VisjectMeta Meta;
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
|
||||||
GraphNode()
|
GraphNode()
|
||||||
: ID(0)
|
: ID(0)
|
||||||
, Type(0)
|
, Type(0)
|
||||||
@@ -154,7 +148,6 @@ public:
|
|||||||
}
|
}
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Gets all the valid boxes.
|
/// Gets all the valid boxes.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
|||||||
@@ -41,9 +41,8 @@ API_ENUM() enum class ChannelMask
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
API_CLASS() class FLAXENGINE_API GraphParameter : public ScriptingObject
|
API_CLASS() class FLAXENGINE_API GraphParameter : public ScriptingObject
|
||||||
{
|
{
|
||||||
DECLARE_SCRIPTING_TYPE_WITH_CONSTRUCTOR_IMPL(GraphParameter, ScriptingObject);
|
DECLARE_SCRIPTING_TYPE_WITH_CONSTRUCTOR_IMPL(GraphParameter, ScriptingObject);
|
||||||
public:
|
public:
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Parameter type
|
/// Parameter type
|
||||||
/// </summary>
|
/// </summary>
|
||||||
@@ -75,7 +74,6 @@ public:
|
|||||||
VisjectMeta Meta;
|
VisjectMeta Meta;
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Gets the typename of the parameter type (excluding in-build types).
|
/// Gets the typename of the parameter type (excluding in-build types).
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
|||||||
@@ -64,7 +64,7 @@ void ShaderGenerator::ProcessGroupConstants(Box* box, Node* node, Value& value)
|
|||||||
{
|
{
|
||||||
switch (node->TypeID)
|
switch (node->TypeID)
|
||||||
{
|
{
|
||||||
// Constant value
|
// Constant value
|
||||||
case 1:
|
case 1:
|
||||||
case 2:
|
case 2:
|
||||||
case 3:
|
case 3:
|
||||||
@@ -96,7 +96,7 @@ void ShaderGenerator::ProcessGroupConstants(Box* box, Node* node, Value& value)
|
|||||||
value = Value::Zero;
|
value = Value::Zero;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
// PI
|
// PI
|
||||||
case 10:
|
case 10:
|
||||||
{
|
{
|
||||||
value = Value(PI);
|
value = Value(PI);
|
||||||
@@ -129,7 +129,7 @@ void ShaderGenerator::ProcessGroupMath(Box* box, Node* node, Value& value)
|
|||||||
{
|
{
|
||||||
switch (node->TypeID)
|
switch (node->TypeID)
|
||||||
{
|
{
|
||||||
// Add, Subtract, Multiply, Divide, Modulo
|
// Add, Subtract, Multiply, Divide, Modulo
|
||||||
case 1:
|
case 1:
|
||||||
case 2:
|
case 2:
|
||||||
case 3:
|
case 3:
|
||||||
@@ -175,7 +175,7 @@ void ShaderGenerator::ProcessGroupMath(Box* box, Node* node, Value& value)
|
|||||||
value = writeOperation2(node, v1, v2, op);
|
value = writeOperation2(node, v1, v2, op);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
// Absolute Value, Ceil, Cosine, Floor, Normalize, Round, Saturate, Sine, Sqrt, Tangent
|
// Absolute Value, Ceil, Cosine, Floor, Normalize, Round, Saturate, Sine, Sqrt, Tangent
|
||||||
case 7:
|
case 7:
|
||||||
case 8:
|
case 8:
|
||||||
case 9:
|
case 9:
|
||||||
@@ -193,14 +193,14 @@ void ShaderGenerator::ProcessGroupMath(Box* box, Node* node, Value& value)
|
|||||||
value = writeFunction1(node, v1, function);
|
value = writeFunction1(node, v1, function);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
// Length
|
// Length
|
||||||
case 11:
|
case 11:
|
||||||
{
|
{
|
||||||
String text = String::Format(TEXT("length({0})"), tryGetValue(node->GetBox(0), Value::Zero).Value);
|
String text = String::Format(TEXT("length({0})"), tryGetValue(node->GetBox(0), Value::Zero).Value);
|
||||||
value = writeLocal(ValueType::Float, text, node);
|
value = writeLocal(ValueType::Float, text, node);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
// Cross, Max, Min, Pow
|
// Cross, Max, Min, Pow
|
||||||
case 18:
|
case 18:
|
||||||
case 21:
|
case 21:
|
||||||
case 22:
|
case 22:
|
||||||
@@ -214,7 +214,7 @@ void ShaderGenerator::ProcessGroupMath(Box* box, Node* node, Value& value)
|
|||||||
value = writeFunction2(node, v1, v2, function);
|
value = writeFunction2(node, v1, v2, function);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
// Distance, Dot
|
// Distance, Dot
|
||||||
case 19:
|
case 19:
|
||||||
case 20:
|
case 20:
|
||||||
{
|
{
|
||||||
@@ -226,7 +226,7 @@ void ShaderGenerator::ProcessGroupMath(Box* box, Node* node, Value& value)
|
|||||||
value = writeFunction2(node, v1, v2, function, ValueType::Float);
|
value = writeFunction2(node, v1, v2, function, ValueType::Float);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
// Clamp
|
// Clamp
|
||||||
case 24:
|
case 24:
|
||||||
{
|
{
|
||||||
Box* b1 = node->GetBox(0);
|
Box* b1 = node->GetBox(0);
|
||||||
@@ -238,7 +238,7 @@ void ShaderGenerator::ProcessGroupMath(Box* box, Node* node, Value& value)
|
|||||||
value = writeFunction3(node, v1, v2, v3, TEXT("clamp"), v1.Type);
|
value = writeFunction3(node, v1, v2, v3, TEXT("clamp"), v1.Type);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
// Lerp
|
// Lerp
|
||||||
case 25:
|
case 25:
|
||||||
{
|
{
|
||||||
Value a = tryGetValue(node->GetBox(0), 0, Value::Zero);
|
Value a = tryGetValue(node->GetBox(0), 0, Value::Zero);
|
||||||
@@ -248,7 +248,7 @@ void ShaderGenerator::ProcessGroupMath(Box* box, Node* node, Value& value)
|
|||||||
value = writeLocal(a.Type, text, node);
|
value = writeLocal(a.Type, text, node);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
// Reflect
|
// Reflect
|
||||||
case 26:
|
case 26:
|
||||||
{
|
{
|
||||||
Box* b1 = node->GetBox(0);
|
Box* b1 = node->GetBox(0);
|
||||||
@@ -259,7 +259,7 @@ void ShaderGenerator::ProcessGroupMath(Box* box, Node* node, Value& value)
|
|||||||
value = writeFunction2(node, v1, v2, function);
|
value = writeFunction2(node, v1, v2, function);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
// Negate
|
// Negate
|
||||||
case 27:
|
case 27:
|
||||||
{
|
{
|
||||||
Box* b1 = node->GetBox(0);
|
Box* b1 = node->GetBox(0);
|
||||||
@@ -267,21 +267,21 @@ void ShaderGenerator::ProcessGroupMath(Box* box, Node* node, Value& value)
|
|||||||
value = writeLocal(v1.Type, String(TEXT("-")) + v1.Value, node);
|
value = writeLocal(v1.Type, String(TEXT("-")) + v1.Value, node);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
// 1 - Value
|
// 1 - Value
|
||||||
case 28:
|
case 28:
|
||||||
{
|
{
|
||||||
Value v1 = tryGetValue(node->GetBox(0), Value::Zero);
|
Value v1 = tryGetValue(node->GetBox(0), Value::Zero);
|
||||||
value = writeOperation2(node, Value::InitForOne(v1.Type), v1, '-');
|
value = writeOperation2(node, Value::InitForOne(v1.Type), v1, '-');
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
// Derive Normal Z
|
// Derive Normal Z
|
||||||
case 29:
|
case 29:
|
||||||
{
|
{
|
||||||
Value inXY = tryGetValue(node->GetBox(0), Value::Zero).AsFloat2();
|
Value inXY = tryGetValue(node->GetBox(0), Value::Zero).AsFloat2();
|
||||||
value = writeLocal(ValueType::Float3, String::Format(TEXT("float3({0}, sqrt(saturate(1.0 - dot({0}.xy, {0}.xy))))"), inXY.Value), node);
|
value = writeLocal(ValueType::Float3, String::Format(TEXT("float3({0}, sqrt(saturate(1.0 - dot({0}.xy, {0}.xy))))"), inXY.Value), node);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
// Mad
|
// Mad
|
||||||
case 31:
|
case 31:
|
||||||
{
|
{
|
||||||
Value v1 = tryGetValue(node->GetBox(0), Value::Zero);
|
Value v1 = tryGetValue(node->GetBox(0), Value::Zero);
|
||||||
@@ -291,7 +291,7 @@ void ShaderGenerator::ProcessGroupMath(Box* box, Node* node, Value& value)
|
|||||||
value = writeLocal(v1.Type, text, node);
|
value = writeLocal(v1.Type, text, node);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
// Extract Largest Component
|
// Extract Largest Component
|
||||||
case 32:
|
case 32:
|
||||||
{
|
{
|
||||||
Value v1 = tryGetValue(node->GetBox(0), Value::Zero);
|
Value v1 = tryGetValue(node->GetBox(0), Value::Zero);
|
||||||
@@ -300,25 +300,25 @@ void ShaderGenerator::ProcessGroupMath(Box* box, Node* node, Value& value)
|
|||||||
_includes.Add(TEXT("./Flax/Math.hlsl"));
|
_includes.Add(TEXT("./Flax/Math.hlsl"));
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
// Asine
|
// Asine
|
||||||
case 33:
|
case 33:
|
||||||
{
|
{
|
||||||
value = writeFunction1(node, tryGetValue(node->GetBox(0), Value::Zero), TEXT("asin"));
|
value = writeFunction1(node, tryGetValue(node->GetBox(0), Value::Zero), TEXT("asin"));
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
// Acosine
|
// Acosine
|
||||||
case 34:
|
case 34:
|
||||||
{
|
{
|
||||||
value = writeFunction1(node, tryGetValue(node->GetBox(0), Value::Zero), TEXT("acos"));
|
value = writeFunction1(node, tryGetValue(node->GetBox(0), Value::Zero), TEXT("acos"));
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
// Atan
|
// Atan
|
||||||
case 35:
|
case 35:
|
||||||
{
|
{
|
||||||
value = writeFunction1(node, tryGetValue(node->GetBox(0), Value::Zero), TEXT("atan"));
|
value = writeFunction1(node, tryGetValue(node->GetBox(0), Value::Zero), TEXT("atan"));
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
// Bias and Scale
|
// Bias and Scale
|
||||||
case 36:
|
case 36:
|
||||||
{
|
{
|
||||||
ASSERT(node->Values.Count() == 2 && node->Values[0].Type == VariantType::Float && node->Values[1].Type == VariantType::Float);
|
ASSERT(node->Values.Count() == 2 && node->Values[0].Type == VariantType::Float && node->Values[1].Type == VariantType::Float);
|
||||||
@@ -329,7 +329,7 @@ void ShaderGenerator::ProcessGroupMath(Box* box, Node* node, Value& value)
|
|||||||
value = writeLocal(input.Type, text, node);
|
value = writeLocal(input.Type, text, node);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
// Rotate About Axis
|
// Rotate About Axis
|
||||||
case 37:
|
case 37:
|
||||||
{
|
{
|
||||||
const auto normalizedRotationAxis = tryGetValue(node->GetBox(0), Value::Zero).AsFloat3();
|
const auto normalizedRotationAxis = tryGetValue(node->GetBox(0), Value::Zero).AsFloat3();
|
||||||
@@ -341,19 +341,19 @@ void ShaderGenerator::ProcessGroupMath(Box* box, Node* node, Value& value)
|
|||||||
value = writeLocal(ValueType::Float3, text, node);
|
value = writeLocal(ValueType::Float3, text, node);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
// Trunc
|
// Trunc
|
||||||
case 38:
|
case 38:
|
||||||
{
|
{
|
||||||
value = writeFunction1(node, tryGetValue(node->GetBox(0), Value::Zero), TEXT("trunc"));
|
value = writeFunction1(node, tryGetValue(node->GetBox(0), Value::Zero), TEXT("trunc"));
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
// Frac
|
// Frac
|
||||||
case 39:
|
case 39:
|
||||||
{
|
{
|
||||||
value = writeFunction1(node, tryGetValue(node->GetBox(0), Value::Zero), TEXT("frac"));
|
value = writeFunction1(node, tryGetValue(node->GetBox(0), Value::Zero), TEXT("frac"));
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
// Fmod
|
// Fmod
|
||||||
case 40:
|
case 40:
|
||||||
{
|
{
|
||||||
Value v1 = tryGetValue(node->GetBox(0), Value::Zero);
|
Value v1 = tryGetValue(node->GetBox(0), Value::Zero);
|
||||||
@@ -361,7 +361,7 @@ void ShaderGenerator::ProcessGroupMath(Box* box, Node* node, Value& value)
|
|||||||
value = writeFunction2(node, v1, v2, TEXT("fmod"));
|
value = writeFunction2(node, v1, v2, TEXT("fmod"));
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
// Atan2
|
// Atan2
|
||||||
case 41:
|
case 41:
|
||||||
{
|
{
|
||||||
Value v1 = tryGetValue(node->GetBox(0), Value::Zero);
|
Value v1 = tryGetValue(node->GetBox(0), Value::Zero);
|
||||||
@@ -369,7 +369,7 @@ void ShaderGenerator::ProcessGroupMath(Box* box, Node* node, Value& value)
|
|||||||
value = writeFunction2(node, v1, v2, TEXT("atan2"));
|
value = writeFunction2(node, v1, v2, TEXT("atan2"));
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
// Near Equal
|
// Near Equal
|
||||||
case 42:
|
case 42:
|
||||||
{
|
{
|
||||||
Value v1 = tryGetValue(node->GetBox(0), Value::Zero);
|
Value v1 = tryGetValue(node->GetBox(0), Value::Zero);
|
||||||
@@ -378,30 +378,30 @@ void ShaderGenerator::ProcessGroupMath(Box* box, Node* node, Value& value)
|
|||||||
value = writeLocal(ValueType::Bool, String::Format(TEXT("distance({0},{1}) < {2}"), v1.Value, v2.Value, epsilon.Value), node);
|
value = writeLocal(ValueType::Bool, String::Format(TEXT("distance({0},{1}) < {2}"), v1.Value, v2.Value, epsilon.Value), node);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
// Degrees
|
// Degrees
|
||||||
case 43:
|
case 43:
|
||||||
{
|
{
|
||||||
value = writeFunction1(node, tryGetValue(node->GetBox(0), Value::Zero), TEXT("degrees"));
|
value = writeFunction1(node, tryGetValue(node->GetBox(0), Value::Zero), TEXT("degrees"));
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
// Radians
|
// Radians
|
||||||
case 44:
|
case 44:
|
||||||
{
|
{
|
||||||
value = writeFunction1(node, tryGetValue(node->GetBox(0), Value::Zero), TEXT("radians"));
|
value = writeFunction1(node, tryGetValue(node->GetBox(0), Value::Zero), TEXT("radians"));
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
// Remap
|
// Remap
|
||||||
case 48:
|
case 48:
|
||||||
{
|
{
|
||||||
const auto inVal = tryGetValue(node->GetBox(0), node->Values[0].AsFloat);
|
const auto inVal = tryGetValue(node->GetBox(0), node->Values[0].AsFloat);
|
||||||
const auto rangeA = tryGetValue(node->GetBox(1), node->Values[1].AsFloat2());
|
const auto rangeA = tryGetValue(node->GetBox(1), node->Values[1].AsFloat2());
|
||||||
const auto rangeB = tryGetValue(node->GetBox(2), node->Values[2].AsFloat2());
|
const auto rangeB = tryGetValue(node->GetBox(2), node->Values[2].AsFloat2());
|
||||||
const auto clamp = tryGetValue(node->GetBox(3), node->Values[3]).AsBool();
|
const auto clamp = tryGetValue(node->GetBox(3), node->Values[3]).AsBool();
|
||||||
const auto mapFunc = String::Format(TEXT("{2}.x + ({0} - {1}.x) * ({2}.y - {2}.x) / ({1}.y - {1}.x)"), inVal.Value, rangeA.Value, rangeB.Value);
|
const auto mapFunc = String::Format(TEXT("{2}.x + ({0} - {1}.x) * ({2}.y - {2}.x) / ({1}.y - {1}.x)"), inVal.Value, rangeA.Value, rangeB.Value);
|
||||||
value = writeLocal(ValueType::Float, String::Format(TEXT("{2} ? clamp({0}, {1}.x, {1}.y) : {0}"), mapFunc, rangeB.Value, clamp.Value), node);
|
value = writeLocal(ValueType::Float, String::Format(TEXT("{2} ? clamp({0}, {1}.x, {1}.y) : {0}"), mapFunc, rangeB.Value, clamp.Value), node);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
// Rotate Vector
|
// Rotate Vector
|
||||||
case 49:
|
case 49:
|
||||||
{
|
{
|
||||||
const Value quaternion = tryGetValue(node->GetBox(0), Value::InitForZero(VariantType::Quaternion)).Cast(VariantType::Quaternion);
|
const Value quaternion = tryGetValue(node->GetBox(0), Value::InitForZero(VariantType::Quaternion)).Cast(VariantType::Quaternion);
|
||||||
@@ -418,7 +418,7 @@ void ShaderGenerator::ProcessGroupPacking(Box* box, Node* node, Value& value)
|
|||||||
{
|
{
|
||||||
switch (node->TypeID)
|
switch (node->TypeID)
|
||||||
{
|
{
|
||||||
// Pack
|
// Pack
|
||||||
case 20:
|
case 20:
|
||||||
{
|
{
|
||||||
Box* bX = node->GetBox(1);
|
Box* bX = node->GetBox(1);
|
||||||
@@ -460,7 +460,7 @@ void ShaderGenerator::ProcessGroupPacking(Box* box, Node* node, Value& value)
|
|||||||
value = Value::Zero;
|
value = Value::Zero;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
// Unpack
|
// Unpack
|
||||||
case 30:
|
case 30:
|
||||||
{
|
{
|
||||||
Box* b = node->GetBox(0);
|
Box* b = node->GetBox(0);
|
||||||
@@ -502,7 +502,7 @@ void ShaderGenerator::ProcessGroupPacking(Box* box, Node* node, Value& value)
|
|||||||
value = Value::Zero;
|
value = Value::Zero;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
// Mask X, Y, Z, W
|
// Mask X, Y, Z, W
|
||||||
case 40:
|
case 40:
|
||||||
case 41:
|
case 41:
|
||||||
case 42:
|
case 42:
|
||||||
@@ -512,7 +512,7 @@ void ShaderGenerator::ProcessGroupPacking(Box* box, Node* node, Value& value)
|
|||||||
value = Value(ValueType::Float, v.Value + _subs[node->TypeID - 40]);
|
value = Value(ValueType::Float, v.Value + _subs[node->TypeID - 40]);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
// Mask XY, YZ, XZ,...
|
// Mask XY, YZ, XZ,...
|
||||||
case 44:
|
case 44:
|
||||||
{
|
{
|
||||||
value = tryGetValue(node->GetBox(0), Float2::Zero).AsFloat2();
|
value = tryGetValue(node->GetBox(0), Float2::Zero).AsFloat2();
|
||||||
@@ -536,13 +536,13 @@ void ShaderGenerator::ProcessGroupPacking(Box* box, Node* node, Value& value)
|
|||||||
value = Value(ValueType::Float2, v.Value + TEXT(".zw"));
|
value = Value(ValueType::Float2, v.Value + TEXT(".zw"));
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
// Mask XYZ
|
// Mask XYZ
|
||||||
case 70:
|
case 70:
|
||||||
{
|
{
|
||||||
value = tryGetValue(node->GetBox(0), Float4::Zero).AsFloat3();
|
value = tryGetValue(node->GetBox(0), Float4::Zero).AsFloat3();
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
// Append
|
// Append
|
||||||
case 100:
|
case 100:
|
||||||
{
|
{
|
||||||
auto in0 = node->GetBox(0);
|
auto in0 = node->GetBox(0);
|
||||||
@@ -586,7 +586,7 @@ void ShaderGenerator::ProcessGroupTools(Box* box, Node* node, Value& value)
|
|||||||
{
|
{
|
||||||
switch (node->TypeID)
|
switch (node->TypeID)
|
||||||
{
|
{
|
||||||
// Desaturation
|
// Desaturation
|
||||||
case 2:
|
case 2:
|
||||||
{
|
{
|
||||||
Value input = tryGetValue(node->GetBox(0), Value::Zero).AsFloat3();
|
Value input = tryGetValue(node->GetBox(0), Value::Zero).AsFloat3();
|
||||||
@@ -596,7 +596,7 @@ void ShaderGenerator::ProcessGroupTools(Box* box, Node* node, Value& value)
|
|||||||
value = writeFunction3(node, input, dot, scale, TEXT("lerp"), ValueType::Float3);
|
value = writeFunction3(node, input, dot, scale, TEXT("lerp"), ValueType::Float3);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
// Color Gradient
|
// Color Gradient
|
||||||
case 10:
|
case 10:
|
||||||
{
|
{
|
||||||
Value time, prevTime, curTime;
|
Value time, prevTime, curTime;
|
||||||
@@ -661,7 +661,7 @@ void ShaderGenerator::ProcessGroupTools(Box* box, Node* node, Value& value)
|
|||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
// Curve
|
// Curve
|
||||||
#define SAMPLE_CURVE(id, curves, type, graphType) \
|
#define SAMPLE_CURVE(id, curves, type, graphType) \
|
||||||
case id: \
|
case id: \
|
||||||
{ \
|
{ \
|
||||||
@@ -675,7 +675,7 @@ void ShaderGenerator::ProcessGroupTools(Box* box, Node* node, Value& value)
|
|||||||
SAMPLE_CURVE(14, Float3Curves, AsFloat3, Float3)
|
SAMPLE_CURVE(14, Float3Curves, AsFloat3, Float3)
|
||||||
SAMPLE_CURVE(15, Float4Curves, AsFloat4, Float4)
|
SAMPLE_CURVE(15, Float4Curves, AsFloat4, Float4)
|
||||||
#undef SETUP_CURVE
|
#undef SETUP_CURVE
|
||||||
// Get Gameplay Global
|
// Get Gameplay Global
|
||||||
case 16:
|
case 16:
|
||||||
{
|
{
|
||||||
// Get the variable type
|
// Get the variable type
|
||||||
@@ -723,7 +723,7 @@ void ShaderGenerator::ProcessGroupTools(Box* box, Node* node, Value& value)
|
|||||||
value.Value = param->ShaderName;
|
value.Value = param->ShaderName;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
// Platform Switch
|
// Platform Switch
|
||||||
case 17:
|
case 17:
|
||||||
{
|
{
|
||||||
bool usesAnyPlatformSpecificInput = false;
|
bool usesAnyPlatformSpecificInput = false;
|
||||||
@@ -768,7 +768,7 @@ void ShaderGenerator::ProcessGroupTools(Box* box, Node* node, Value& value)
|
|||||||
#undef PLATFORM_CASE
|
#undef PLATFORM_CASE
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
// Reroute
|
// Reroute
|
||||||
case 29:
|
case 29:
|
||||||
value = tryGetValue(node->GetBox(0), Value::Zero);
|
value = tryGetValue(node->GetBox(0), Value::Zero);
|
||||||
break;
|
break;
|
||||||
@@ -781,7 +781,7 @@ void ShaderGenerator::ProcessGroupBoolean(Box* box, Node* node, Value& value)
|
|||||||
{
|
{
|
||||||
switch (node->TypeID)
|
switch (node->TypeID)
|
||||||
{
|
{
|
||||||
// NOT
|
// NOT
|
||||||
case 1:
|
case 1:
|
||||||
{
|
{
|
||||||
// Get A value
|
// Get A value
|
||||||
@@ -791,7 +791,7 @@ void ShaderGenerator::ProcessGroupBoolean(Box* box, Node* node, Value& value)
|
|||||||
value = writeLocal(ValueType::Bool, String::Format(TEXT("!{0}"), a.Value), node);
|
value = writeLocal(ValueType::Bool, String::Format(TEXT("!{0}"), a.Value), node);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
// AND, OR, XOR, NOR, NAND
|
// AND, OR, XOR, NOR, NAND
|
||||||
case 2:
|
case 2:
|
||||||
case 3:
|
case 3:
|
||||||
case 4:
|
case 4:
|
||||||
@@ -806,28 +806,28 @@ void ShaderGenerator::ProcessGroupBoolean(Box* box, Node* node, Value& value)
|
|||||||
const Char* op;
|
const Char* op;
|
||||||
switch (node->TypeID)
|
switch (node->TypeID)
|
||||||
{
|
{
|
||||||
// AND
|
// AND
|
||||||
case 2:
|
case 2:
|
||||||
op = TEXT("{0} && {1}");
|
op = TEXT("{0} && {1}");
|
||||||
break;
|
break;
|
||||||
// OR
|
// OR
|
||||||
case 3:
|
case 3:
|
||||||
op = TEXT("{0} || {1}");
|
op = TEXT("{0} || {1}");
|
||||||
break;
|
break;
|
||||||
// XOR
|
// XOR
|
||||||
case 4:
|
case 4:
|
||||||
op = TEXT("!{0} != !{1}");
|
op = TEXT("!{0} != !{1}");
|
||||||
break;
|
break;
|
||||||
// NOR
|
// NOR
|
||||||
case 5:
|
case 5:
|
||||||
op = TEXT("!({0} || {1})");
|
op = TEXT("!({0} || {1})");
|
||||||
break;
|
break;
|
||||||
// NAND
|
// NAND
|
||||||
case 6:
|
case 6:
|
||||||
op = TEXT("!({0} && {1})");
|
op = TEXT("!({0} && {1})");
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
CRASH;
|
CRASH;
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
value = writeLocal(ValueType::Bool, String::Format(op, a.Value, b.Value), node);
|
value = writeLocal(ValueType::Bool, String::Format(op, a.Value, b.Value), node);
|
||||||
@@ -842,7 +842,7 @@ void ShaderGenerator::ProcessGroupBitwise(Box* box, Node* node, Value& value)
|
|||||||
{
|
{
|
||||||
switch (node->TypeID)
|
switch (node->TypeID)
|
||||||
{
|
{
|
||||||
// NOT
|
// NOT
|
||||||
case 1:
|
case 1:
|
||||||
{
|
{
|
||||||
// Get A value
|
// Get A value
|
||||||
@@ -852,7 +852,7 @@ void ShaderGenerator::ProcessGroupBitwise(Box* box, Node* node, Value& value)
|
|||||||
value = writeLocal(ValueType::Int, String::Format(TEXT("!{0}"), a.Value), node);
|
value = writeLocal(ValueType::Int, String::Format(TEXT("!{0}"), a.Value), node);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
// AND, OR, XOR
|
// AND, OR, XOR
|
||||||
case 2:
|
case 2:
|
||||||
case 3:
|
case 3:
|
||||||
case 4:
|
case 4:
|
||||||
@@ -865,20 +865,20 @@ void ShaderGenerator::ProcessGroupBitwise(Box* box, Node* node, Value& value)
|
|||||||
const Char* op;
|
const Char* op;
|
||||||
switch (node->TypeID)
|
switch (node->TypeID)
|
||||||
{
|
{
|
||||||
// AND
|
// AND
|
||||||
case 2:
|
case 2:
|
||||||
op = TEXT("{0} & {1}");
|
op = TEXT("{0} & {1}");
|
||||||
break;
|
break;
|
||||||
// OR
|
// OR
|
||||||
case 3:
|
case 3:
|
||||||
op = TEXT("{0} | {1}");
|
op = TEXT("{0} | {1}");
|
||||||
break;
|
break;
|
||||||
// XOR
|
// XOR
|
||||||
case 4:
|
case 4:
|
||||||
op = TEXT("{0} ^ {1}");
|
op = TEXT("{0} ^ {1}");
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
CRASH;
|
CRASH;
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
value = writeLocal(ValueType::Int, String::Format(op, a.Value, b.Value), node);
|
value = writeLocal(ValueType::Int, String::Format(op, a.Value, b.Value), node);
|
||||||
@@ -893,7 +893,7 @@ void ShaderGenerator::ProcessGroupComparisons(Box* box, Node* node, Value& value
|
|||||||
{
|
{
|
||||||
switch (node->TypeID)
|
switch (node->TypeID)
|
||||||
{
|
{
|
||||||
// ==, !=, >, <=, >=
|
// ==, !=, >, <=, >=
|
||||||
case 1:
|
case 1:
|
||||||
case 2:
|
case 2:
|
||||||
case 3:
|
case 3:
|
||||||
@@ -928,13 +928,13 @@ void ShaderGenerator::ProcessGroupComparisons(Box* box, Node* node, Value& value
|
|||||||
op = TEXT("{0} >= {1}");
|
op = TEXT("{0} >= {1}");
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
CRASH;
|
CRASH;
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
value = writeLocal(ValueType::Bool, String::Format(op, a.Value, b.Value), node);
|
value = writeLocal(ValueType::Bool, String::Format(op, a.Value, b.Value), node);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
// Switch On Bool
|
// Switch On Bool
|
||||||
case 7:
|
case 7:
|
||||||
{
|
{
|
||||||
const Value condition = tryGetValue(node->GetBox(0), Value::False).AsBool();
|
const Value condition = tryGetValue(node->GetBox(0), Value::False).AsBool();
|
||||||
@@ -1114,7 +1114,7 @@ ShaderGenerator::Value ShaderGenerator::writeLocal(ValueType type, const String&
|
|||||||
|
|
||||||
ShaderGenerator::Value ShaderGenerator::writeOperation2(Node* caller, const Value& valueA, const Value& valueB, Char op1)
|
ShaderGenerator::Value ShaderGenerator::writeOperation2(Node* caller, const Value& valueA, const Value& valueB, Char op1)
|
||||||
{
|
{
|
||||||
const Char op1Str[2] = { op1, 0};
|
const Char op1Str[2] = { op1, 0 };
|
||||||
const String value = String::Format(TEXT("{0} {1} {2}"), valueA.Value, op1Str, Value::Cast(valueB, valueA.Type).Value);
|
const String value = String::Format(TEXT("{0} {1} {2}"), valueA.Value, op1Str, Value::Cast(valueB, valueA.Type).Value);
|
||||||
return writeLocal(valueA.Type, value, caller);
|
return writeLocal(valueA.Type, value, caller);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -23,14 +23,12 @@ class ShaderGraphNode;
|
|||||||
class ShaderGraphBox : public GraphBox
|
class ShaderGraphBox : public GraphBox
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// The cached value.
|
/// The cached value.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
ShaderGraphValue Cache;
|
ShaderGraphValue Cache;
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
|
||||||
ShaderGraphBox()
|
ShaderGraphBox()
|
||||||
: GraphBox()
|
: GraphBox()
|
||||||
{
|
{
|
||||||
@@ -47,7 +45,6 @@ public:
|
|||||||
}
|
}
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
|
||||||
FORCE_INLINE ShaderGraphBox* FirstConnection() const
|
FORCE_INLINE ShaderGraphBox* FirstConnection() const
|
||||||
{
|
{
|
||||||
return (ShaderGraphBox*)Connections[0];
|
return (ShaderGraphBox*)Connections[0];
|
||||||
@@ -58,7 +55,6 @@ template<class BoxType = ShaderGraphBox>
|
|||||||
class ShaderGraphNode : public GraphNode<BoxType>
|
class ShaderGraphNode : public GraphNode<BoxType>
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
|
|
||||||
struct CurveData
|
struct CurveData
|
||||||
{
|
{
|
||||||
/// <summary>
|
/// <summary>
|
||||||
@@ -79,14 +75,12 @@ public:
|
|||||||
};
|
};
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
|
||||||
ShaderGraphNode()
|
ShaderGraphNode()
|
||||||
: GraphNode<ShaderGraphBox>()
|
: GraphNode<ShaderGraphBox>()
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// The custom data (depends on node type). Used to cache data for faster usage at runtime.
|
/// The custom data (depends on node type). Used to cache data for faster usage at runtime.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
@@ -96,7 +90,6 @@ public:
|
|||||||
class ShaderGraphParameter : public GraphParameter
|
class ShaderGraphParameter : public GraphParameter
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
|
|
||||||
ShaderGraphParameter()
|
ShaderGraphParameter()
|
||||||
: GraphParameter(SpawnParams(Guid::New(), TypeInitializer))
|
: GraphParameter(SpawnParams(Guid::New(), TypeInitializer))
|
||||||
{
|
{
|
||||||
@@ -123,12 +116,10 @@ template<class NodeType = ShaderGraphNode<>, class BoxType = ShaderGraphBox, cla
|
|||||||
class ShaderGraph : public Graph<NodeType, BoxType, ParameterType>
|
class ShaderGraph : public Graph<NodeType, BoxType, ParameterType>
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
|
|
||||||
typedef ShaderGraphValue Value;
|
typedef ShaderGraphValue Value;
|
||||||
typedef Graph<NodeType, BoxType, ParameterType> Base;
|
typedef Graph<NodeType, BoxType, ParameterType> Base;
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// The float curves used by the graph.
|
/// The float curves used by the graph.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
@@ -150,18 +141,17 @@ public:
|
|||||||
Array<BezierCurve<Float4>> Float4Curves;
|
Array<BezierCurve<Float4>> Float4Curves;
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
|
||||||
// [Graph]
|
// [Graph]
|
||||||
bool onNodeLoaded(NodeType* n) override
|
bool onNodeLoaded(NodeType* n) override
|
||||||
{
|
{
|
||||||
// Check if this node needs a state or data cache
|
// Check if this node needs a state or data cache
|
||||||
switch (n->GroupID)
|
switch (n->GroupID)
|
||||||
{
|
{
|
||||||
// Tools
|
// Tools
|
||||||
case 7:
|
case 7:
|
||||||
switch (n->TypeID)
|
switch (n->TypeID)
|
||||||
{
|
{
|
||||||
// Curves
|
// Curves
|
||||||
#define SETUP_CURVE(id, curves, access) \
|
#define SETUP_CURVE(id, curves, access) \
|
||||||
case id: \
|
case id: \
|
||||||
{ \
|
{ \
|
||||||
@@ -201,7 +191,6 @@ public:
|
|||||||
class ShaderGenerator
|
class ShaderGenerator
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
|
|
||||||
typedef ShaderGraph<> Graph;
|
typedef ShaderGraph<> Graph;
|
||||||
typedef ShaderGraph<>::Node Node;
|
typedef ShaderGraph<>::Node Node;
|
||||||
typedef ShaderGraph<>::Box Box;
|
typedef ShaderGraph<>::Box Box;
|
||||||
@@ -212,7 +201,6 @@ public:
|
|||||||
typedef Function<void(Box*, Node*, Value&)> ProcessBoxHandler;
|
typedef Function<void(Box*, Node*, Value&)> ProcessBoxHandler;
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
|
|
||||||
int32 _localIndex;
|
int32 _localIndex;
|
||||||
Dictionary<Node*, Graph*> _functions;
|
Dictionary<Node*, Graph*> _functions;
|
||||||
Array<SerializedMaterialParam> _parameters;
|
Array<SerializedMaterialParam> _parameters;
|
||||||
@@ -223,7 +211,6 @@ protected:
|
|||||||
Array<Graph*, FixedAllocation<32>> _graphStack;
|
Array<Graph*, FixedAllocation<32>> _graphStack;
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Initializes a new instance of the <see cref="ShaderGenerator"/> class.
|
/// Initializes a new instance of the <see cref="ShaderGenerator"/> class.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
@@ -235,7 +222,6 @@ public:
|
|||||||
~ShaderGenerator();
|
~ShaderGenerator();
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
|
||||||
ErrorHandler Error;
|
ErrorHandler Error;
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
@@ -244,7 +230,6 @@ public:
|
|||||||
AssetsContainer Assets;
|
AssetsContainer Assets;
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
|
||||||
void OnError(Node* node, Box* box, const StringView& message);
|
void OnError(Node* node, Box* box, const StringView& message);
|
||||||
|
|
||||||
void ProcessGroupConstants(Box* box, Node* node, Value& value);
|
void ProcessGroupConstants(Box* box, Node* node, Value& value);
|
||||||
@@ -256,12 +241,10 @@ public:
|
|||||||
void ProcessGroupComparisons(Box* box, Node* node, Value& value);
|
void ProcessGroupComparisons(Box* box, Node* node, Value& value);
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
|
|
||||||
static const Char* _mathFunctions[];
|
static const Char* _mathFunctions[];
|
||||||
static const Char* _subs[];
|
static const Char* _subs[];
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
|
|
||||||
Value eatBox(Node* caller, Box* box);
|
Value eatBox(Node* caller, Box* box);
|
||||||
Value tryGetValue(Box* box, int32 defaultValueBoxIndex, const Value& defaultValue);
|
Value tryGetValue(Box* box, int32 defaultValueBoxIndex, const Value& defaultValue);
|
||||||
Value tryGetValue(Box* box, const Value& defaultValue);
|
Value tryGetValue(Box* box, const Value& defaultValue);
|
||||||
|
|||||||
@@ -12,11 +12,9 @@
|
|||||||
struct ShaderGraphValue : Object
|
struct ShaderGraphValue : Object
|
||||||
{
|
{
|
||||||
private:
|
private:
|
||||||
|
|
||||||
static const Char* _subs[];
|
static const Char* _subs[];
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// The value type.
|
/// The value type.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
@@ -28,7 +26,6 @@ public:
|
|||||||
String Value;
|
String Value;
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Zero value (as float).
|
/// Zero value (as float).
|
||||||
/// </summary>
|
/// </summary>
|
||||||
@@ -55,7 +52,6 @@ public:
|
|||||||
static const ShaderGraphValue False;
|
static const ShaderGraphValue False;
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Initializes a new instance of the <see cref="ShaderGraphValue"/> struct.
|
/// Initializes a new instance of the <see cref="ShaderGraphValue"/> struct.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
@@ -134,7 +130,6 @@ public:
|
|||||||
explicit ShaderGraphValue(const Variant& v);
|
explicit ShaderGraphValue(const Variant& v);
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Returns true if value is valid.
|
/// Returns true if value is valid.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
@@ -175,7 +170,6 @@ public:
|
|||||||
}
|
}
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Formats thw value.
|
/// Formats thw value.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
@@ -227,7 +221,6 @@ public:
|
|||||||
}
|
}
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Initializes the shader variable for given connection type Zero.
|
/// Initializes the shader variable for given connection type Zero.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
@@ -301,7 +294,6 @@ public:
|
|||||||
}
|
}
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Gets the X component of the value. Valid only for single or vector types.
|
/// Gets the X component of the value. Valid only for single or vector types.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
@@ -339,7 +331,6 @@ public:
|
|||||||
}
|
}
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Casts the value to the bool type.
|
/// Casts the value to the bool type.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
@@ -422,7 +413,6 @@ public:
|
|||||||
static ShaderGraphValue Cast(const ShaderGraphValue& v, VariantType::Types to);
|
static ShaderGraphValue Cast(const ShaderGraphValue& v, VariantType::Types to);
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
|
||||||
// [Object]
|
// [Object]
|
||||||
String ToString() const override
|
String ToString() const override
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -51,7 +51,7 @@ void VisjectExecutor::ProcessGroupConstants(Box* box, Node* node, Value& value)
|
|||||||
{
|
{
|
||||||
switch (node->TypeID)
|
switch (node->TypeID)
|
||||||
{
|
{
|
||||||
// Constant value
|
// Constant value
|
||||||
case 1:
|
case 1:
|
||||||
case 2:
|
case 2:
|
||||||
case 3:
|
case 3:
|
||||||
@@ -89,15 +89,15 @@ void VisjectExecutor::ProcessGroupConstants(Box* box, Node* node, Value& value)
|
|||||||
case 9:
|
case 9:
|
||||||
value = node->Values[0];
|
value = node->Values[0];
|
||||||
break;
|
break;
|
||||||
// PI
|
// PI
|
||||||
case 10:
|
case 10:
|
||||||
value = PI;
|
value = PI;
|
||||||
break;
|
break;
|
||||||
// Enum
|
// Enum
|
||||||
case 11:
|
case 11:
|
||||||
value = node->Values[0];
|
value = node->Values[0];
|
||||||
break;
|
break;
|
||||||
// Array
|
// Array
|
||||||
case 13:
|
case 13:
|
||||||
value = node->Values[0];
|
value = node->Values[0];
|
||||||
if (value.Type.Type == VariantType::Array)
|
if (value.Type.Type == VariantType::Array)
|
||||||
@@ -152,7 +152,7 @@ void VisjectExecutor::ProcessGroupMath(Box* box, Node* node, Value& value)
|
|||||||
{
|
{
|
||||||
switch (node->TypeID)
|
switch (node->TypeID)
|
||||||
{
|
{
|
||||||
// Add, Subtract, Multiply, Divide, Modulo, Max, Min, Pow, Fmod, Atan2
|
// Add, Subtract, Multiply, Divide, Modulo, Max, Min, Pow, Fmod, Atan2
|
||||||
case 1:
|
case 1:
|
||||||
case 2:
|
case 2:
|
||||||
case 3:
|
case 3:
|
||||||
@@ -174,7 +174,7 @@ void VisjectExecutor::ProcessGroupMath(Box* box, Node* node, Value& value)
|
|||||||
GraphUtilities::ApplySomeMathHere(node->TypeID, value, v1, v2);
|
GraphUtilities::ApplySomeMathHere(node->TypeID, value, v1, v2);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
// Absolute Value, Ceil, Cosine, Floor, Round, Saturate, Sine, Sqrt, Tangent, Negate, 1 - Value, Asine, Acosine, Atan, Trunc, Frac, Degrees, Radians
|
// Absolute Value, Ceil, Cosine, Floor, Round, Saturate, Sine, Sqrt, Tangent, Negate, 1 - Value, Asine, Acosine, Atan, Trunc, Frac, Degrees, Radians
|
||||||
case 7:
|
case 7:
|
||||||
case 8:
|
case 8:
|
||||||
case 9:
|
case 9:
|
||||||
@@ -198,7 +198,7 @@ void VisjectExecutor::ProcessGroupMath(Box* box, Node* node, Value& value)
|
|||||||
GraphUtilities::ApplySomeMathHere(node->TypeID, value, v1);
|
GraphUtilities::ApplySomeMathHere(node->TypeID, value, v1);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
// Length, Normalize
|
// Length, Normalize
|
||||||
case 11:
|
case 11:
|
||||||
case 12:
|
case 12:
|
||||||
{
|
{
|
||||||
@@ -269,7 +269,7 @@ void VisjectExecutor::ProcessGroupMath(Box* box, Node* node, Value& value)
|
|||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
// Cross, Distance, Dot
|
// Cross, Distance, Dot
|
||||||
case 18:
|
case 18:
|
||||||
case 19:
|
case 19:
|
||||||
case 20:
|
case 20:
|
||||||
@@ -346,7 +346,7 @@ void VisjectExecutor::ProcessGroupMath(Box* box, Node* node, Value& value)
|
|||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
// Clamp
|
// Clamp
|
||||||
case 24:
|
case 24:
|
||||||
{
|
{
|
||||||
Value v1 = tryGetValue(node->GetBox(0), Value::Zero);
|
Value v1 = tryGetValue(node->GetBox(0), Value::Zero);
|
||||||
@@ -358,7 +358,7 @@ void VisjectExecutor::ProcessGroupMath(Box* box, Node* node, Value& value)
|
|||||||
});
|
});
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
// Lerp
|
// Lerp
|
||||||
case 25:
|
case 25:
|
||||||
{
|
{
|
||||||
Value a = tryGetValue(node->GetBox(0), 0, Value::Zero);
|
Value a = tryGetValue(node->GetBox(0), 0, Value::Zero);
|
||||||
@@ -367,7 +367,7 @@ void VisjectExecutor::ProcessGroupMath(Box* box, Node* node, Value& value)
|
|||||||
value = Value::Lerp(a, b, alpha.AsFloat);
|
value = Value::Lerp(a, b, alpha.AsFloat);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
// Reflect
|
// Reflect
|
||||||
case 26:
|
case 26:
|
||||||
{
|
{
|
||||||
Value v1 = tryGetValue(node->GetBox(0), Value::Zero);
|
Value v1 = tryGetValue(node->GetBox(0), Value::Zero);
|
||||||
@@ -388,7 +388,7 @@ void VisjectExecutor::ProcessGroupMath(Box* box, Node* node, Value& value)
|
|||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
// Mad
|
// Mad
|
||||||
case 31:
|
case 31:
|
||||||
{
|
{
|
||||||
Value v1 = tryGetValue(node->GetBox(0), Value::Zero);
|
Value v1 = tryGetValue(node->GetBox(0), Value::Zero);
|
||||||
@@ -400,14 +400,14 @@ void VisjectExecutor::ProcessGroupMath(Box* box, Node* node, Value& value)
|
|||||||
});
|
});
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
// Extract Largest Component
|
// Extract Largest Component
|
||||||
case 32:
|
case 32:
|
||||||
{
|
{
|
||||||
const auto v1 = (Float3)tryGetValue(node->GetBox(0), Value::Zero);
|
const auto v1 = (Float3)tryGetValue(node->GetBox(0), Value::Zero);
|
||||||
value = Math::ExtractLargestComponent(v1);
|
value = Math::ExtractLargestComponent(v1);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
// Bias and Scale
|
// Bias and Scale
|
||||||
case 36:
|
case 36:
|
||||||
{
|
{
|
||||||
ASSERT(node->Values.Count() == 2 && node->Values[0].Type == VariantType::Float && node->Values[1].Type == VariantType::Float);
|
ASSERT(node->Values.Count() == 2 && node->Values[0].Type == VariantType::Float && node->Values[1].Type == VariantType::Float);
|
||||||
@@ -417,7 +417,7 @@ void VisjectExecutor::ProcessGroupMath(Box* box, Node* node, Value& value)
|
|||||||
value = (input + bias) * scale;
|
value = (input + bias) * scale;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
// Rotate About Axis
|
// Rotate About Axis
|
||||||
case 37:
|
case 37:
|
||||||
{
|
{
|
||||||
const auto normalizedRotationAxis = (Float3)tryGetValue(node->GetBox(0), Value::Zero);
|
const auto normalizedRotationAxis = (Float3)tryGetValue(node->GetBox(0), Value::Zero);
|
||||||
@@ -427,7 +427,7 @@ void VisjectExecutor::ProcessGroupMath(Box* box, Node* node, Value& value)
|
|||||||
value = Math::RotateAboutAxis(normalizedRotationAxis, rotationAngle, pivotPoint, position);
|
value = Math::RotateAboutAxis(normalizedRotationAxis, rotationAngle, pivotPoint, position);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
// Near Equal
|
// Near Equal
|
||||||
case 42:
|
case 42:
|
||||||
{
|
{
|
||||||
const Value a = tryGetValue(node->GetBox(0), node->Values[0]);
|
const Value a = tryGetValue(node->GetBox(0), node->Values[0]);
|
||||||
@@ -436,23 +436,23 @@ void VisjectExecutor::ProcessGroupMath(Box* box, Node* node, Value& value)
|
|||||||
value = Value::NearEqual(a, b, epsilon);
|
value = Value::NearEqual(a, b, epsilon);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
// Enum Value
|
// Enum Value
|
||||||
case 45:
|
case 45:
|
||||||
value = (uint64)tryGetValue(node->GetBox(0), Value::Zero);
|
value = (uint64)tryGetValue(node->GetBox(0), Value::Zero);
|
||||||
break;
|
break;
|
||||||
// Enum AND
|
// Enum AND
|
||||||
case 46:
|
case 46:
|
||||||
value = tryGetValue(node->GetBox(0), Value::Zero);
|
value = tryGetValue(node->GetBox(0), Value::Zero);
|
||||||
if (value.Type.Type == VariantType::Enum)
|
if (value.Type.Type == VariantType::Enum)
|
||||||
value.AsUint64 = value.AsUint64 & (uint64)tryGetValue(node->GetBox(1), Value::Zero);
|
value.AsUint64 = value.AsUint64 & (uint64)tryGetValue(node->GetBox(1), Value::Zero);
|
||||||
break;
|
break;
|
||||||
// Enum OR
|
// Enum OR
|
||||||
case 47:
|
case 47:
|
||||||
value = tryGetValue(node->GetBox(0), Value::Zero);
|
value = tryGetValue(node->GetBox(0), Value::Zero);
|
||||||
if (value.Type.Type == VariantType::Enum)
|
if (value.Type.Type == VariantType::Enum)
|
||||||
value.AsUint64 = value.AsUint64 | (uint64)tryGetValue(node->GetBox(1), Value::Zero);
|
value.AsUint64 = value.AsUint64 | (uint64)tryGetValue(node->GetBox(1), Value::Zero);
|
||||||
break;
|
break;
|
||||||
// Remap
|
// Remap
|
||||||
case 48:
|
case 48:
|
||||||
{
|
{
|
||||||
const float inVal = tryGetValue(node->GetBox(0), node->Values[0]).AsFloat;
|
const float inVal = tryGetValue(node->GetBox(0), node->Values[0]).AsFloat;
|
||||||
@@ -463,7 +463,7 @@ void VisjectExecutor::ProcessGroupMath(Box* box, Node* node, Value& value)
|
|||||||
value = clamp ? Math::Clamp(mapFunc, rangeB.X, rangeB.Y) : mapFunc;
|
value = clamp ? Math::Clamp(mapFunc, rangeB.X, rangeB.Y) : mapFunc;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
// Rotate Vector
|
// Rotate Vector
|
||||||
case 49:
|
case 49:
|
||||||
{
|
{
|
||||||
const Quaternion quaternion = (Quaternion)tryGetValue(node->GetBox(0), Quaternion::Identity);
|
const Quaternion quaternion = (Quaternion)tryGetValue(node->GetBox(0), Quaternion::Identity);
|
||||||
@@ -480,7 +480,7 @@ void VisjectExecutor::ProcessGroupPacking(Box* box, Node* node, Value& value)
|
|||||||
{
|
{
|
||||||
switch (node->TypeID)
|
switch (node->TypeID)
|
||||||
{
|
{
|
||||||
// Pack
|
// Pack
|
||||||
case 20:
|
case 20:
|
||||||
{
|
{
|
||||||
float vX = (float)tryGetValue(node->GetBox(1), node->Values[0]);
|
float vX = (float)tryGetValue(node->GetBox(1), node->Values[0]);
|
||||||
@@ -528,7 +528,7 @@ void VisjectExecutor::ProcessGroupPacking(Box* box, Node* node, Value& value)
|
|||||||
value = Variant(BoundingBox(vX, vY));
|
value = Variant(BoundingBox(vX, vY));
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
// Unpack
|
// Unpack
|
||||||
case 30:
|
case 30:
|
||||||
{
|
{
|
||||||
Float2 v = (Float2)tryGetValue(node->GetBox(0), Float2::Zero);
|
Float2 v = (Float2)tryGetValue(node->GetBox(0), Float2::Zero);
|
||||||
@@ -592,7 +592,7 @@ void VisjectExecutor::ProcessGroupPacking(Box* box, Node* node, Value& value)
|
|||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
// Pack Structure
|
// Pack Structure
|
||||||
case 26:
|
case 26:
|
||||||
{
|
{
|
||||||
// Find type
|
// Find type
|
||||||
@@ -675,7 +675,7 @@ void VisjectExecutor::ProcessGroupPacking(Box* box, Node* node, Value& value)
|
|||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
// Unpack Structure
|
// Unpack Structure
|
||||||
case 36:
|
case 36:
|
||||||
{
|
{
|
||||||
// Get value with structure data
|
// Get value with structure data
|
||||||
@@ -765,7 +765,7 @@ void VisjectExecutor::ProcessGroupPacking(Box* box, Node* node, Value& value)
|
|||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
// Mask X, Y, Z, W
|
// Mask X, Y, Z, W
|
||||||
case 40:
|
case 40:
|
||||||
case 41:
|
case 41:
|
||||||
case 42:
|
case 42:
|
||||||
@@ -775,7 +775,7 @@ void VisjectExecutor::ProcessGroupPacking(Box* box, Node* node, Value& value)
|
|||||||
value = v.Raw[node->TypeID - 40];
|
value = v.Raw[node->TypeID - 40];
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
// Mask XY, YZ, XZ,...
|
// Mask XY, YZ, XZ,...
|
||||||
case 44:
|
case 44:
|
||||||
{
|
{
|
||||||
value = (Float2)tryGetValue(node->GetBox(0), Float2::Zero);
|
value = (Float2)tryGetValue(node->GetBox(0), Float2::Zero);
|
||||||
@@ -799,13 +799,13 @@ void VisjectExecutor::ProcessGroupPacking(Box* box, Node* node, Value& value)
|
|||||||
value = Float2(v.Z, v.W);
|
value = Float2(v.Z, v.W);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
// Mask XYZ
|
// Mask XYZ
|
||||||
case 70:
|
case 70:
|
||||||
{
|
{
|
||||||
value = (Float3)tryGetValue(node->GetBox(0), Float3::Zero);
|
value = (Float3)tryGetValue(node->GetBox(0), Float3::Zero);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
// Append
|
// Append
|
||||||
case 100:
|
case 100:
|
||||||
{
|
{
|
||||||
auto in0 = node->GetBox(0);
|
auto in0 = node->GetBox(0);
|
||||||
@@ -860,7 +860,7 @@ void VisjectExecutor::ProcessGroupTools(Box* box, Node* node, Value& value)
|
|||||||
{
|
{
|
||||||
switch (node->TypeID)
|
switch (node->TypeID)
|
||||||
{
|
{
|
||||||
// Color Gradient
|
// Color Gradient
|
||||||
case 10:
|
case 10:
|
||||||
{
|
{
|
||||||
float time, prevTime, curTime;
|
float time, prevTime, curTime;
|
||||||
@@ -916,7 +916,7 @@ void VisjectExecutor::ProcessGroupTools(Box* box, Node* node, Value& value)
|
|||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
// Curve
|
// Curve
|
||||||
#define SAMPLE_CURVE(id, curves, type, graphType) \
|
#define SAMPLE_CURVE(id, curves, type, graphType) \
|
||||||
case id: \
|
case id: \
|
||||||
{ \
|
{ \
|
||||||
@@ -931,7 +931,7 @@ void VisjectExecutor::ProcessGroupTools(Box* box, Node* node, Value& value)
|
|||||||
SAMPLE_CURVE(14, Float3Curves, Float3, Float3)
|
SAMPLE_CURVE(14, Float3Curves, Float3, Float3)
|
||||||
SAMPLE_CURVE(15, Float4Curves, Float4, Float4)
|
SAMPLE_CURVE(15, Float4Curves, Float4, Float4)
|
||||||
#undef SETUP_CURVE
|
#undef SETUP_CURVE
|
||||||
// Get Gameplay Global
|
// Get Gameplay Global
|
||||||
case 16:
|
case 16:
|
||||||
if (const auto asset = node->Assets[0].As<GameplayGlobals>())
|
if (const auto asset = node->Assets[0].As<GameplayGlobals>())
|
||||||
{
|
{
|
||||||
@@ -944,7 +944,7 @@ void VisjectExecutor::ProcessGroupTools(Box* box, Node* node, Value& value)
|
|||||||
value = Value::Zero;
|
value = Value::Zero;
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
// Platform Switch
|
// Platform Switch
|
||||||
case 17:
|
case 17:
|
||||||
{
|
{
|
||||||
int32 boxId = 1;
|
int32 boxId = 1;
|
||||||
@@ -985,19 +985,19 @@ void VisjectExecutor::ProcessGroupTools(Box* box, Node* node, Value& value)
|
|||||||
value = tryGetValue(node->GetBox(node->GetBox(boxId)->HasConnection() ? boxId : 1), Value::Zero);
|
value = tryGetValue(node->GetBox(node->GetBox(boxId)->HasConnection() ? boxId : 1), Value::Zero);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
// Asset Reference
|
// Asset Reference
|
||||||
case 18:
|
case 18:
|
||||||
value = ::LoadAsset((Guid)node->Values[0], Asset::TypeInitializer);
|
value = ::LoadAsset((Guid)node->Values[0], Asset::TypeInitializer);
|
||||||
break;
|
break;
|
||||||
// To String
|
// To String
|
||||||
case 20:
|
case 20:
|
||||||
value.SetString(tryGetValue(node->GetBox(1), Value(StringView::Empty)).ToString());
|
value.SetString(tryGetValue(node->GetBox(1), Value(StringView::Empty)).ToString());
|
||||||
break;
|
break;
|
||||||
// Actor Reference
|
// Actor Reference
|
||||||
case 21:
|
case 21:
|
||||||
value = Scripting::FindObject<Actor>((Guid)node->Values[0]);
|
value = Scripting::FindObject<Actor>((Guid)node->Values[0]);
|
||||||
break;
|
break;
|
||||||
// As
|
// As
|
||||||
case 22:
|
case 22:
|
||||||
{
|
{
|
||||||
value = Value::Null;
|
value = Value::Null;
|
||||||
@@ -1013,7 +1013,7 @@ void VisjectExecutor::ProcessGroupTools(Box* box, Node* node, Value& value)
|
|||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
// Type Reference node
|
// Type Reference node
|
||||||
case 23:
|
case 23:
|
||||||
{
|
{
|
||||||
const StringView typeName(node->Values[0]);
|
const StringView typeName(node->Values[0]);
|
||||||
@@ -1023,7 +1023,7 @@ void VisjectExecutor::ProcessGroupTools(Box* box, Node* node, Value& value)
|
|||||||
value = typeName;
|
value = typeName;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
// Is
|
// Is
|
||||||
case 24:
|
case 24:
|
||||||
{
|
{
|
||||||
value = Value::False;
|
value = Value::False;
|
||||||
@@ -1038,15 +1038,15 @@ void VisjectExecutor::ProcessGroupTools(Box* box, Node* node, Value& value)
|
|||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
// Is Null
|
// Is Null
|
||||||
case 27:
|
case 27:
|
||||||
value = (void*)tryGetValue(node->GetBox(1), Value::Null) == nullptr;
|
value = (void*)tryGetValue(node->GetBox(1), Value::Null) == nullptr;
|
||||||
break;
|
break;
|
||||||
// Is Valid
|
// Is Valid
|
||||||
case 28:
|
case 28:
|
||||||
value = (void*)tryGetValue(node->GetBox(1), Value::Null) != nullptr;
|
value = (void*)tryGetValue(node->GetBox(1), Value::Null) != nullptr;
|
||||||
break;
|
break;
|
||||||
// Reroute
|
// Reroute
|
||||||
case 29:
|
case 29:
|
||||||
value = tryGetValue(node->GetBox(0), Value::Zero);
|
value = tryGetValue(node->GetBox(0), Value::Zero);
|
||||||
break;
|
break;
|
||||||
@@ -1059,14 +1059,14 @@ void VisjectExecutor::ProcessGroupBoolean(Box* box, Node* node, Value& value)
|
|||||||
{
|
{
|
||||||
switch (node->TypeID)
|
switch (node->TypeID)
|
||||||
{
|
{
|
||||||
// NOT
|
// NOT
|
||||||
case 1:
|
case 1:
|
||||||
{
|
{
|
||||||
const bool a = (bool)tryGetValue(node->GetBox(0), Value::False);
|
const bool a = (bool)tryGetValue(node->GetBox(0), Value::False);
|
||||||
value = !a;
|
value = !a;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
// AND, OR, XOR, NOR, NAND
|
// AND, OR, XOR, NOR, NAND
|
||||||
case 2:
|
case 2:
|
||||||
case 3:
|
case 3:
|
||||||
case 4:
|
case 4:
|
||||||
@@ -1078,23 +1078,23 @@ void VisjectExecutor::ProcessGroupBoolean(Box* box, Node* node, Value& value)
|
|||||||
bool result = false;
|
bool result = false;
|
||||||
switch (node->TypeID)
|
switch (node->TypeID)
|
||||||
{
|
{
|
||||||
// AND
|
// AND
|
||||||
case 2:
|
case 2:
|
||||||
result = a && b;
|
result = a && b;
|
||||||
break;
|
break;
|
||||||
// OR
|
// OR
|
||||||
case 3:
|
case 3:
|
||||||
result = a || b;
|
result = a || b;
|
||||||
break;
|
break;
|
||||||
// XOR
|
// XOR
|
||||||
case 4:
|
case 4:
|
||||||
result = !a != !b;
|
result = !a != !b;
|
||||||
break;
|
break;
|
||||||
// NOR
|
// NOR
|
||||||
case 5:
|
case 5:
|
||||||
result = !(a || b);
|
result = !(a || b);
|
||||||
break;
|
break;
|
||||||
// NAND
|
// NAND
|
||||||
case 6:
|
case 6:
|
||||||
result = !(a && b);
|
result = !(a && b);
|
||||||
break;
|
break;
|
||||||
@@ -1111,14 +1111,14 @@ void VisjectExecutor::ProcessGroupBitwise(Box* box, Node* node, Value& value)
|
|||||||
{
|
{
|
||||||
switch (node->TypeID)
|
switch (node->TypeID)
|
||||||
{
|
{
|
||||||
// NOT
|
// NOT
|
||||||
case 1:
|
case 1:
|
||||||
{
|
{
|
||||||
const int32 a = (int32)tryGetValue(node->GetBox(0), Value(0));
|
const int32 a = (int32)tryGetValue(node->GetBox(0), Value(0));
|
||||||
value = !a;
|
value = !a;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
// AND, OR, XOR
|
// AND, OR, XOR
|
||||||
case 2:
|
case 2:
|
||||||
case 3:
|
case 3:
|
||||||
case 4:
|
case 4:
|
||||||
@@ -1128,15 +1128,15 @@ void VisjectExecutor::ProcessGroupBitwise(Box* box, Node* node, Value& value)
|
|||||||
int32 result = 0;
|
int32 result = 0;
|
||||||
switch (node->TypeID)
|
switch (node->TypeID)
|
||||||
{
|
{
|
||||||
// AND
|
// AND
|
||||||
case 2:
|
case 2:
|
||||||
result = a & b;
|
result = a & b;
|
||||||
break;
|
break;
|
||||||
// OR
|
// OR
|
||||||
case 3:
|
case 3:
|
||||||
result = a | b;
|
result = a | b;
|
||||||
break;
|
break;
|
||||||
// XOR
|
// XOR
|
||||||
case 4:
|
case 4:
|
||||||
result = a ^ b;
|
result = a ^ b;
|
||||||
break;
|
break;
|
||||||
@@ -1153,7 +1153,7 @@ void VisjectExecutor::ProcessGroupComparisons(Box* box, Node* node, Value& value
|
|||||||
{
|
{
|
||||||
switch (node->TypeID)
|
switch (node->TypeID)
|
||||||
{
|
{
|
||||||
// ==, !=, >, <=, >=
|
// ==, !=, >, <=, >=
|
||||||
case 1:
|
case 1:
|
||||||
case 2:
|
case 2:
|
||||||
case 3:
|
case 3:
|
||||||
@@ -1188,7 +1188,7 @@ void VisjectExecutor::ProcessGroupComparisons(Box* box, Node* node, Value& value
|
|||||||
value = result;
|
value = result;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
// Switch On Bool
|
// Switch On Bool
|
||||||
case 7:
|
case 7:
|
||||||
{
|
{
|
||||||
const Value condition = tryGetValue(node->GetBox(0), Value::False);
|
const Value condition = tryGetValue(node->GetBox(0), Value::False);
|
||||||
@@ -1198,7 +1198,7 @@ void VisjectExecutor::ProcessGroupComparisons(Box* box, Node* node, Value& value
|
|||||||
value = tryGetValue(node->GetBox(1), 0, Value::Zero);
|
value = tryGetValue(node->GetBox(1), 0, Value::Zero);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
// Switch On Enum
|
// Switch On Enum
|
||||||
case 8:
|
case 8:
|
||||||
{
|
{
|
||||||
const Value v = tryGetValue(node->GetBox(0), Value::Null);
|
const Value v = tryGetValue(node->GetBox(0), Value::Null);
|
||||||
@@ -1227,31 +1227,31 @@ void VisjectExecutor::ProcessGroupParticles(Box* box, Node* node, Value& value)
|
|||||||
{
|
{
|
||||||
switch (node->TypeID)
|
switch (node->TypeID)
|
||||||
{
|
{
|
||||||
// Random Float
|
// Random Float
|
||||||
case 208:
|
case 208:
|
||||||
{
|
{
|
||||||
value = RAND;
|
value = RAND;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
// Random Vector2
|
// Random Vector2
|
||||||
case 209:
|
case 209:
|
||||||
{
|
{
|
||||||
value = Float2(RAND, RAND);
|
value = Float2(RAND, RAND);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
// Random Vector3
|
// Random Vector3
|
||||||
case 210:
|
case 210:
|
||||||
{
|
{
|
||||||
value = Float3(RAND, RAND, RAND);
|
value = Float3(RAND, RAND, RAND);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
// Random Vector4
|
// Random Vector4
|
||||||
case 211:
|
case 211:
|
||||||
{
|
{
|
||||||
value = Float4(RAND, RAND, RAND, RAND);
|
value = Float4(RAND, RAND, RAND, RAND);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
// Random Float Range
|
// Random Float Range
|
||||||
case 213:
|
case 213:
|
||||||
{
|
{
|
||||||
auto& a = node->Values[0].AsFloat;
|
auto& a = node->Values[0].AsFloat;
|
||||||
@@ -1259,7 +1259,7 @@ void VisjectExecutor::ProcessGroupParticles(Box* box, Node* node, Value& value)
|
|||||||
value = Math::Lerp(a, b, RAND);
|
value = Math::Lerp(a, b, RAND);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
// Random Vector2 Range
|
// Random Vector2 Range
|
||||||
case 214:
|
case 214:
|
||||||
{
|
{
|
||||||
auto a = (Float2)node->Values[0];
|
auto a = (Float2)node->Values[0];
|
||||||
@@ -1270,7 +1270,7 @@ void VisjectExecutor::ProcessGroupParticles(Box* box, Node* node, Value& value)
|
|||||||
);
|
);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
// Random Vector3 Range
|
// Random Vector3 Range
|
||||||
case 215:
|
case 215:
|
||||||
{
|
{
|
||||||
auto a = (Float3)node->Values[0];
|
auto a = (Float3)node->Values[0];
|
||||||
@@ -1282,7 +1282,7 @@ void VisjectExecutor::ProcessGroupParticles(Box* box, Node* node, Value& value)
|
|||||||
);
|
);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
// Random Vector4 Range
|
// Random Vector4 Range
|
||||||
case 216:
|
case 216:
|
||||||
{
|
{
|
||||||
auto a = (Float4)node->Values[0];
|
auto a = (Float4)node->Values[0];
|
||||||
@@ -1313,39 +1313,39 @@ void VisjectExecutor::ProcessGroupCollections(Box* box, Node* node, Value& value
|
|||||||
Box* b;
|
Box* b;
|
||||||
switch (node->TypeID)
|
switch (node->TypeID)
|
||||||
{
|
{
|
||||||
// Count
|
// Count
|
||||||
case 1:
|
case 1:
|
||||||
value = array.Count();
|
value = array.Count();
|
||||||
break;
|
break;
|
||||||
// Contains
|
// Contains
|
||||||
case 2:
|
case 2:
|
||||||
value = array.Contains(tryGetValue(node->GetBox(1), Value::Null));
|
value = array.Contains(tryGetValue(node->GetBox(1), Value::Null));
|
||||||
break;
|
break;
|
||||||
// Find
|
// Find
|
||||||
case 3:
|
case 3:
|
||||||
b = node->GetBox(1);
|
b = node->GetBox(1);
|
||||||
ENSURE(b->HasConnection(), TEXT("Missing value to find."));
|
ENSURE(b->HasConnection(), TEXT("Missing value to find."));
|
||||||
value = array.Find(eatBox(b->GetParent<Node>(), b->FirstConnection()));
|
value = array.Find(eatBox(b->GetParent<Node>(), b->FirstConnection()));
|
||||||
break;
|
break;
|
||||||
// Find Last
|
// Find Last
|
||||||
case 4:
|
case 4:
|
||||||
b = node->GetBox(1);
|
b = node->GetBox(1);
|
||||||
ENSURE(b->HasConnection(), TEXT("Missing value to find."));
|
ENSURE(b->HasConnection(), TEXT("Missing value to find."));
|
||||||
value = array.FindLast(eatBox(b->GetParent<Node>(), b->FirstConnection()));
|
value = array.FindLast(eatBox(b->GetParent<Node>(), b->FirstConnection()));
|
||||||
break;
|
break;
|
||||||
// Clear
|
// Clear
|
||||||
case 5:
|
case 5:
|
||||||
array.Clear();
|
array.Clear();
|
||||||
value = MoveTemp(v);
|
value = MoveTemp(v);
|
||||||
break;
|
break;
|
||||||
// Remove
|
// Remove
|
||||||
case 6:
|
case 6:
|
||||||
b = node->GetBox(1);
|
b = node->GetBox(1);
|
||||||
ENSURE(b->HasConnection(), TEXT("Missing value to remove."));
|
ENSURE(b->HasConnection(), TEXT("Missing value to remove."));
|
||||||
array.Remove(eatBox(b->GetParent<Node>(), b->FirstConnection()));
|
array.Remove(eatBox(b->GetParent<Node>(), b->FirstConnection()));
|
||||||
value = MoveTemp(v);
|
value = MoveTemp(v);
|
||||||
break;
|
break;
|
||||||
// Remove At
|
// Remove At
|
||||||
case 7:
|
case 7:
|
||||||
{
|
{
|
||||||
const int32 index = (int32)tryGetValue(node->GetBox(1), 0, Value::Null);
|
const int32 index = (int32)tryGetValue(node->GetBox(1), 0, Value::Null);
|
||||||
@@ -1354,14 +1354,14 @@ void VisjectExecutor::ProcessGroupCollections(Box* box, Node* node, Value& value
|
|||||||
value = MoveTemp(v);
|
value = MoveTemp(v);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
// Add
|
// Add
|
||||||
case 8:
|
case 8:
|
||||||
b = node->GetBox(1);
|
b = node->GetBox(1);
|
||||||
ENSURE(b->HasConnection(), TEXT("Missing value to add."));
|
ENSURE(b->HasConnection(), TEXT("Missing value to add."));
|
||||||
array.Add(eatBox(b->GetParent<Node>(), b->FirstConnection()));
|
array.Add(eatBox(b->GetParent<Node>(), b->FirstConnection()));
|
||||||
value = MoveTemp(v);
|
value = MoveTemp(v);
|
||||||
break;
|
break;
|
||||||
// Insert
|
// Insert
|
||||||
case 9:
|
case 9:
|
||||||
{
|
{
|
||||||
b = node->GetBox(1);
|
b = node->GetBox(1);
|
||||||
@@ -1372,7 +1372,7 @@ void VisjectExecutor::ProcessGroupCollections(Box* box, Node* node, Value& value
|
|||||||
value = MoveTemp(v);
|
value = MoveTemp(v);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
// Get
|
// Get
|
||||||
case 10:
|
case 10:
|
||||||
{
|
{
|
||||||
const int32 index = (int32)tryGetValue(node->GetBox(1), 0, Value::Null);
|
const int32 index = (int32)tryGetValue(node->GetBox(1), 0, Value::Null);
|
||||||
@@ -1380,7 +1380,7 @@ void VisjectExecutor::ProcessGroupCollections(Box* box, Node* node, Value& value
|
|||||||
value = MoveTemp(array[index]);
|
value = MoveTemp(array[index]);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
// Set
|
// Set
|
||||||
case 11:
|
case 11:
|
||||||
{
|
{
|
||||||
b = node->GetBox(2);
|
b = node->GetBox(2);
|
||||||
@@ -1391,17 +1391,17 @@ void VisjectExecutor::ProcessGroupCollections(Box* box, Node* node, Value& value
|
|||||||
value = MoveTemp(v);
|
value = MoveTemp(v);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
// Sort
|
// Sort
|
||||||
case 12:
|
case 12:
|
||||||
Sorting::QuickSort(array.Get(), array.Count());
|
Sorting::QuickSort(array.Get(), array.Count());
|
||||||
value = MoveTemp(v);
|
value = MoveTemp(v);
|
||||||
break;
|
break;
|
||||||
// Reverse
|
// Reverse
|
||||||
case 13:
|
case 13:
|
||||||
array.Reverse();
|
array.Reverse();
|
||||||
value = MoveTemp(v);
|
value = MoveTemp(v);
|
||||||
break;
|
break;
|
||||||
// Add Unique
|
// Add Unique
|
||||||
case 14:
|
case 14:
|
||||||
b = node->GetBox(1);
|
b = node->GetBox(1);
|
||||||
ENSURE(b->HasConnection(), TEXT("Missing value to add."));
|
ENSURE(b->HasConnection(), TEXT("Missing value to add."));
|
||||||
|
|||||||
@@ -19,7 +19,6 @@ class VisjectGraphNode;
|
|||||||
class VisjectGraphBox : public GraphBox
|
class VisjectGraphBox : public GraphBox
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
|
|
||||||
VisjectGraphBox()
|
VisjectGraphBox()
|
||||||
: GraphBox()
|
: GraphBox()
|
||||||
{
|
{
|
||||||
@@ -45,7 +44,6 @@ template<class BoxType = VisjectGraphBox>
|
|||||||
class VisjectGraphNode : public GraphNode<BoxType>
|
class VisjectGraphNode : public GraphNode<BoxType>
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
|
|
||||||
struct CurveData
|
struct CurveData
|
||||||
{
|
{
|
||||||
/// <summary>
|
/// <summary>
|
||||||
@@ -82,14 +80,12 @@ public:
|
|||||||
};
|
};
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
|
||||||
VisjectGraphNode()
|
VisjectGraphNode()
|
||||||
: GraphNode<BoxType>()
|
: GraphNode<BoxType>()
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// The custom data (depends on node type). Used to cache data for faster usage at runtime.
|
/// The custom data (depends on node type). Used to cache data for faster usage at runtime.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
@@ -107,9 +103,8 @@ public:
|
|||||||
/// <seealso cref="GraphParameter" />
|
/// <seealso cref="GraphParameter" />
|
||||||
API_CLASS() class VisjectGraphParameter : public GraphParameter
|
API_CLASS() class VisjectGraphParameter : public GraphParameter
|
||||||
{
|
{
|
||||||
DECLARE_SCRIPTING_TYPE_WITH_CONSTRUCTOR_IMPL(VisjectGraphParameter, GraphParameter);
|
DECLARE_SCRIPTING_TYPE_WITH_CONSTRUCTOR_IMPL(VisjectGraphParameter, GraphParameter);
|
||||||
public:
|
public:
|
||||||
|
|
||||||
VisjectGraphParameter(const VisjectGraphParameter& other)
|
VisjectGraphParameter(const VisjectGraphParameter& other)
|
||||||
: VisjectGraphParameter()
|
: VisjectGraphParameter()
|
||||||
{
|
{
|
||||||
@@ -136,7 +131,6 @@ public:
|
|||||||
typedef Graph<NodeType, BoxType, ParameterType> Base;
|
typedef Graph<NodeType, BoxType, ParameterType> Base;
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// The float curves used by the graph.
|
/// The float curves used by the graph.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
@@ -158,17 +152,16 @@ public:
|
|||||||
Array<BezierCurve<Float4>> Float4Curves;
|
Array<BezierCurve<Float4>> Float4Curves;
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
|
||||||
// [Graph]
|
// [Graph]
|
||||||
bool onNodeLoaded(NodeType* n) override
|
bool onNodeLoaded(NodeType* n) override
|
||||||
{
|
{
|
||||||
switch (n->GroupID)
|
switch (n->GroupID)
|
||||||
{
|
{
|
||||||
// Tools
|
// Tools
|
||||||
case 7:
|
case 7:
|
||||||
switch (n->TypeID)
|
switch (n->TypeID)
|
||||||
{
|
{
|
||||||
// Curves
|
// Curves
|
||||||
#define SETUP_CURVE(id, curves, access) \
|
#define SETUP_CURVE(id, curves, access) \
|
||||||
case id: \
|
case id: \
|
||||||
{ \
|
{ \
|
||||||
@@ -193,7 +186,7 @@ public:
|
|||||||
SETUP_CURVE(14, Float3Curves, AsFloat3())
|
SETUP_CURVE(14, Float3Curves, AsFloat3())
|
||||||
SETUP_CURVE(15, Float4Curves, AsFloat4())
|
SETUP_CURVE(15, Float4Curves, AsFloat4())
|
||||||
#undef SETUP_CURVE
|
#undef SETUP_CURVE
|
||||||
// Get Gameplay Global
|
// Get Gameplay Global
|
||||||
case 16:
|
case 16:
|
||||||
{
|
{
|
||||||
n->Assets[0] = ::LoadAsset((Guid)n->Values[0], Asset::TypeInitializer);
|
n->Assets[0] = ::LoadAsset((Guid)n->Values[0], Asset::TypeInitializer);
|
||||||
@@ -223,11 +216,9 @@ public:
|
|||||||
typedef void (VisjectExecutor::*ProcessBoxHandler)(Box*, Node*, Value&);
|
typedef void (VisjectExecutor::*ProcessBoxHandler)(Box*, Node*, Value&);
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
|
|
||||||
ProcessBoxHandler _perGroupProcessCall[19];
|
ProcessBoxHandler _perGroupProcessCall[19];
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Initializes a new instance of the <see cref="VisjectExecutor"/> class.
|
/// Initializes a new instance of the <see cref="VisjectExecutor"/> class.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
@@ -239,11 +230,9 @@ public:
|
|||||||
~VisjectExecutor();
|
~VisjectExecutor();
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
|
||||||
ErrorHandler Error;
|
ErrorHandler Error;
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
|
||||||
virtual void OnError(Node* node, Box* box, const StringView& message);
|
virtual void OnError(Node* node, Box* box, const StringView& message);
|
||||||
|
|
||||||
void ProcessGroupConstants(Box* box, Node* node, Value& value);
|
void ProcessGroupConstants(Box* box, Node* node, Value& value);
|
||||||
@@ -257,7 +246,6 @@ public:
|
|||||||
void ProcessGroupCollections(Box* box, Node* node, Value& value);
|
void ProcessGroupCollections(Box* box, Node* node, Value& value);
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
|
|
||||||
virtual Value eatBox(Node* caller, Box* box) = 0;
|
virtual Value eatBox(Node* caller, Box* box) = 0;
|
||||||
virtual Graph* GetCurrentGraph() const = 0;
|
virtual Graph* GetCurrentGraph() const = 0;
|
||||||
|
|
||||||
|
|||||||
@@ -11,7 +11,6 @@
|
|||||||
class VisjectMeta
|
class VisjectMeta
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Metadata entry
|
/// Metadata entry
|
||||||
/// </summary>
|
/// </summary>
|
||||||
@@ -23,14 +22,12 @@ public:
|
|||||||
};
|
};
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// All meta entries
|
/// All meta entries
|
||||||
/// </summary>
|
/// </summary>
|
||||||
Array<Entry, FixedAllocation<8>> Entries;
|
Array<Entry, FixedAllocation<8>> Entries;
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Initializes a new instance of the <see cref="VisjectMeta"/> class.
|
/// Initializes a new instance of the <see cref="VisjectMeta"/> class.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
@@ -44,7 +41,6 @@ public:
|
|||||||
}
|
}
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Load from the stream
|
/// Load from the stream
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
|||||||
Reference in New Issue
Block a user