初始化内容
This commit is contained in:
Vendored
+2
@@ -0,0 +1,2 @@
|
||||
.idea
|
||||
cmake-build-debug
|
||||
Vendored
+33
@@ -0,0 +1,33 @@
|
||||
# Enable C++ support
|
||||
language: cpp
|
||||
sudo: required
|
||||
dist: trusty
|
||||
|
||||
os:
|
||||
- linux
|
||||
- osx
|
||||
compiler:
|
||||
- gcc
|
||||
- clang
|
||||
install:
|
||||
#Linux
|
||||
- if [ "$TRAVIS_OS_NAME" == "linux" ]; then sudo apt-get install -qq g++-4.8; fi
|
||||
- if [ "$TRAVIS_OS_NAME" != "osx" ] && [ "$CXX" == "g++" ]; then export CXX="g++-5" CC="gcc-5"; fi
|
||||
|
||||
#OS X
|
||||
- if [ "$TRAVIS_OS_NAME" == "osx" ]; then brew update; fi
|
||||
- if [ "$TRAVIS_OS_NAME" == "osx" ]; then brew install gcc48; fi
|
||||
- if [ "$TRAVIS_OS_NAME" == "osx" ] && [ "$CC" == "gcc" ]; then export CC="gcc-4.8"; fi
|
||||
- if [ "$TRAVIS_OS_NAME" == "osx" ] && [ "$CC" == "gcc" ]; then export CXX="g++-4.8"; fi
|
||||
addons:
|
||||
apt:
|
||||
sources:
|
||||
- ubuntu-toolchain-r-test
|
||||
packages:
|
||||
- gcc-5
|
||||
- g++-5
|
||||
- clang
|
||||
script:
|
||||
- mkdir build
|
||||
- cd build
|
||||
- cmake .. && make
|
||||
Vendored
+44
@@ -0,0 +1,44 @@
|
||||
# CMakeLists.txt
|
||||
# Mark Guerra
|
||||
# 11/1/2015
|
||||
|
||||
cmake_minimum_required(VERSION 2.8)
|
||||
project(BigNumber)
|
||||
|
||||
set(BigNumber_VERSION_MAJOR 1)
|
||||
set(BigNumber_VERSION_MINOR 0)
|
||||
|
||||
if (WIN32)
|
||||
set(c++version -std=gnu++14)
|
||||
else()
|
||||
set(c++version -std=c++14)
|
||||
endif()
|
||||
|
||||
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall -Wextra -Weffc++ -pedantic -Wno-unused-function ${c++version}")
|
||||
|
||||
set(CMAKE_BUILD_TYPE Release)
|
||||
|
||||
set(SOURCE_FILES
|
||||
src/bignumber.cpp main.cpp )
|
||||
|
||||
add_library(BigNumber ${SOURCE_FILES})
|
||||
|
||||
set(CMAKE_BUILD_TYPE Debug)
|
||||
|
||||
if(WIN32)
|
||||
install(TARGETS BigNumber DESTINATION C:/Libs/BigNumber/lib)
|
||||
install(FILES src/bignumber.h DESTINATION C:/Libs/BigNumber/include)
|
||||
else()
|
||||
install(TARGETS BigNumber DESTINATION ~/Library/Frameworks/BigNumber/lib)
|
||||
install(FILES src/bignumber.h DESTINATION ~/Library/Frameworks/BigNumber/include)
|
||||
endif()
|
||||
install(TARGETS BigNumber DESTINATION ${CMAKE_CURRENT_LIST_DIR}/bin/BigNumber/lib)
|
||||
install(FILES src/bignumber.h DESTINATION ${CMAKE_CURRENT_LIST_DIR}/bin/BigNumber/include)
|
||||
|
||||
add_custom_command(
|
||||
TARGET BigNumber
|
||||
POST_BUILD
|
||||
COMMAND ${CMAKE_COMMAND} --build ${CMAKE_BINARY_DIR} --target install
|
||||
)
|
||||
|
||||
add_executable(BigNumberRun ${SOURCE_FILES})
|
||||
Vendored
+201
@@ -0,0 +1,201 @@
|
||||
Apache License
|
||||
Version 2.0, January 2004
|
||||
http://www.apache.org/licenses/
|
||||
|
||||
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
|
||||
|
||||
1. Definitions.
|
||||
|
||||
"License" shall mean the terms and conditions for use, reproduction,
|
||||
and distribution as defined by Sections 1 through 9 of this document.
|
||||
|
||||
"Licensor" shall mean the copyright owner or entity authorized by
|
||||
the copyright owner that is granting the License.
|
||||
|
||||
"Legal Entity" shall mean the union of the acting entity and all
|
||||
other entities that control, are controlled by, or are under common
|
||||
control with that entity. For the purposes of this definition,
|
||||
"control" means (i) the power, direct or indirect, to cause the
|
||||
direction or management of such entity, whether by contract or
|
||||
otherwise, or (ii) ownership of fifty percent (50%) or more of the
|
||||
outstanding shares, or (iii) beneficial ownership of such entity.
|
||||
|
||||
"You" (or "Your") shall mean an individual or Legal Entity
|
||||
exercising permissions granted by this License.
|
||||
|
||||
"Source" form shall mean the preferred form for making modifications,
|
||||
including but not limited to software source code, documentation
|
||||
source, and configuration files.
|
||||
|
||||
"Object" form shall mean any form resulting from mechanical
|
||||
transformation or translation of a Source form, including but
|
||||
not limited to compiled object code, generated documentation,
|
||||
and conversions to other media types.
|
||||
|
||||
"Work" shall mean the work of authorship, whether in Source or
|
||||
Object form, made available under the License, as indicated by a
|
||||
copyright notice that is included in or attached to the work
|
||||
(an example is provided in the Appendix below).
|
||||
|
||||
"Derivative Works" shall mean any work, whether in Source or Object
|
||||
form, that is based on (or derived from) the Work and for which the
|
||||
editorial revisions, annotations, elaborations, or other modifications
|
||||
represent, as a whole, an original work of authorship. For the purposes
|
||||
of this License, Derivative Works shall not include works that remain
|
||||
separable from, or merely link (or bind by name) to the interfaces of,
|
||||
the Work and Derivative Works thereof.
|
||||
|
||||
"Contribution" shall mean any work of authorship, including
|
||||
the original version of the Work and any modifications or additions
|
||||
to that Work or Derivative Works thereof, that is intentionally
|
||||
submitted to Licensor for inclusion in the Work by the copyright owner
|
||||
or by an individual or Legal Entity authorized to submit on behalf of
|
||||
the copyright owner. For the purposes of this definition, "submitted"
|
||||
means any form of electronic, verbal, or written communication sent
|
||||
to the Licensor or its representatives, including but not limited to
|
||||
communication on electronic mailing lists, source code control systems,
|
||||
and issue tracking systems that are managed by, or on behalf of, the
|
||||
Licensor for the purpose of discussing and improving the Work, but
|
||||
excluding communication that is conspicuously marked or otherwise
|
||||
designated in writing by the copyright owner as "Not a Contribution."
|
||||
|
||||
"Contributor" shall mean Licensor and any individual or Legal Entity
|
||||
on behalf of whom a Contribution has been received by Licensor and
|
||||
subsequently incorporated within the Work.
|
||||
|
||||
2. Grant of Copyright License. Subject to the terms and conditions of
|
||||
this License, each Contributor hereby grants to You a perpetual,
|
||||
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
||||
copyright license to reproduce, prepare Derivative Works of,
|
||||
publicly display, publicly perform, sublicense, and distribute the
|
||||
Work and such Derivative Works in Source or Object form.
|
||||
|
||||
3. Grant of Patent License. Subject to the terms and conditions of
|
||||
this License, each Contributor hereby grants to You a perpetual,
|
||||
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
||||
(except as stated in this section) patent license to make, have made,
|
||||
use, offer to sell, sell, import, and otherwise transfer the Work,
|
||||
where such license applies only to those patent claims licensable
|
||||
by such Contributor that are necessarily infringed by their
|
||||
Contribution(s) alone or by combination of their Contribution(s)
|
||||
with the Work to which such Contribution(s) was submitted. If You
|
||||
institute patent litigation against any entity (including a
|
||||
cross-claim or counterclaim in a lawsuit) alleging that the Work
|
||||
or a Contribution incorporated within the Work constitutes direct
|
||||
or contributory patent infringement, then any patent licenses
|
||||
granted to You under this License for that Work shall terminate
|
||||
as of the date such litigation is filed.
|
||||
|
||||
4. Redistribution. You may reproduce and distribute copies of the
|
||||
Work or Derivative Works thereof in any medium, with or without
|
||||
modifications, and in Source or Object form, provided that You
|
||||
meet the following conditions:
|
||||
|
||||
(a) You must give any other recipients of the Work or
|
||||
Derivative Works a copy of this License; and
|
||||
|
||||
(b) You must cause any modified files to carry prominent notices
|
||||
stating that You changed the files; and
|
||||
|
||||
(c) You must retain, in the Source form of any Derivative Works
|
||||
that You distribute, all copyright, patent, trademark, and
|
||||
attribution notices from the Source form of the Work,
|
||||
excluding those notices that do not pertain to any part of
|
||||
the Derivative Works; and
|
||||
|
||||
(d) If the Work includes a "NOTICE" text file as part of its
|
||||
distribution, then any Derivative Works that You distribute must
|
||||
include a readable copy of the attribution notices contained
|
||||
within such NOTICE file, excluding those notices that do not
|
||||
pertain to any part of the Derivative Works, in at least one
|
||||
of the following places: within a NOTICE text file distributed
|
||||
as part of the Derivative Works; within the Source form or
|
||||
documentation, if provided along with the Derivative Works; or,
|
||||
within a display generated by the Derivative Works, if and
|
||||
wherever such third-party notices normally appear. The contents
|
||||
of the NOTICE file are for informational purposes only and
|
||||
do not modify the License. You may add Your own attribution
|
||||
notices within Derivative Works that You distribute, alongside
|
||||
or as an addendum to the NOTICE text from the Work, provided
|
||||
that such additional attribution notices cannot be construed
|
||||
as modifying the License.
|
||||
|
||||
You may add Your own copyright statement to Your modifications and
|
||||
may provide additional or different license terms and conditions
|
||||
for use, reproduction, or distribution of Your modifications, or
|
||||
for any such Derivative Works as a whole, provided Your use,
|
||||
reproduction, and distribution of the Work otherwise complies with
|
||||
the conditions stated in this License.
|
||||
|
||||
5. Submission of Contributions. Unless You explicitly state otherwise,
|
||||
any Contribution intentionally submitted for inclusion in the Work
|
||||
by You to the Licensor shall be under the terms and conditions of
|
||||
this License, without any additional terms or conditions.
|
||||
Notwithstanding the above, nothing herein shall supersede or modify
|
||||
the terms of any separate license agreement you may have executed
|
||||
with Licensor regarding such Contributions.
|
||||
|
||||
6. Trademarks. This License does not grant permission to use the trade
|
||||
names, trademarks, service marks, or product names of the Licensor,
|
||||
except as required for reasonable and customary use in describing the
|
||||
origin of the Work and reproducing the content of the NOTICE file.
|
||||
|
||||
7. Disclaimer of Warranty. Unless required by applicable law or
|
||||
agreed to in writing, Licensor provides the Work (and each
|
||||
Contributor provides its Contributions) on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
|
||||
implied, including, without limitation, any warranties or conditions
|
||||
of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
|
||||
PARTICULAR PURPOSE. You are solely responsible for determining the
|
||||
appropriateness of using or redistributing the Work and assume any
|
||||
risks associated with Your exercise of permissions under this License.
|
||||
|
||||
8. Limitation of Liability. In no event and under no legal theory,
|
||||
whether in tort (including negligence), contract, or otherwise,
|
||||
unless required by applicable law (such as deliberate and grossly
|
||||
negligent acts) or agreed to in writing, shall any Contributor be
|
||||
liable to You for damages, including any direct, indirect, special,
|
||||
incidental, or consequential damages of any character arising as a
|
||||
result of this License or out of the use or inability to use the
|
||||
Work (including but not limited to damages for loss of goodwill,
|
||||
work stoppage, computer failure or malfunction, or any and all
|
||||
other commercial damages or losses), even if such Contributor
|
||||
has been advised of the possibility of such damages.
|
||||
|
||||
9. Accepting Warranty or Additional Liability. While redistributing
|
||||
the Work or Derivative Works thereof, You may choose to offer,
|
||||
and charge a fee for, acceptance of support, warranty, indemnity,
|
||||
or other liability obligations and/or rights consistent with this
|
||||
License. However, in accepting such obligations, You may act only
|
||||
on Your own behalf and on Your sole responsibility, not on behalf
|
||||
of any other Contributor, and only if You agree to indemnify,
|
||||
defend, and hold each Contributor harmless for any liability
|
||||
incurred by, or claims asserted against, such Contributor by reason
|
||||
of your accepting any such warranty or additional liability.
|
||||
|
||||
END OF TERMS AND CONDITIONS
|
||||
|
||||
APPENDIX: How to apply the Apache License to your work.
|
||||
|
||||
To apply the Apache License to your work, attach the following
|
||||
boilerplate notice, with the fields enclosed by brackets "{}"
|
||||
replaced with your own identifying information. (Don't include
|
||||
the brackets!) The text should be enclosed in the appropriate
|
||||
comment syntax for the file format. We also recommend that a
|
||||
file or class name and description of purpose be included on the
|
||||
same "printed page" as the copyright notice for easier
|
||||
identification within third-party archives.
|
||||
|
||||
Copyright 2016-2017 Mark Guerra
|
||||
|
||||
Licensed under the Apache License, Version 2.0 (the "License");
|
||||
you may not use this file except in compliance with the License.
|
||||
You may obtain a copy of the License at
|
||||
|
||||
http://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
Unless required by applicable law or agreed to in writing, software
|
||||
distributed under the License is distributed on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
||||
Vendored
+223
@@ -0,0 +1,223 @@
|
||||
# BigNumber
|
||||
|
||||

|
||||
[](https://github.com/Limeoats/BigNumber/blob/master/LICENSE.md)
|
||||
|
||||
BigNumber is a C++ class that allows for the creation and computation of arbitrary-length
|
||||
integers.
|
||||
|
||||
The maximum possible length of a BigNumber is `std::string::max_size`.
|
||||
|
||||
## Installation
|
||||
To add BigNumber to your C++ project, you can download the `bin` folder from this repository, which
|
||||
contains the library and include files.
|
||||
|
||||
Then, simply include the header file in whichever file you need a BigNumber and link to the library file.
|
||||
|
||||
`#include "bignumber.h"`
|
||||
|
||||
## Usage
|
||||
### `BigNumber(string)`
|
||||
|
||||
|
||||
You can also use the `=` operator to set a BigNumber equal to an existing BigNumber, a number, or
|
||||
a string of numbers.
|
||||
|
||||
Examples:
|
||||
|
||||
BigNumber b("5"); //BigNumber b is created with value 5.
|
||||
BigNumber c("-20"); //BigNumber c is created with value -20.
|
||||
BigNumber d("0"); //BigNumber d is created with value 0.
|
||||
BigNumber e = b; //BigNumber e is created with value 5.
|
||||
BigNumber f = 30; //BigNumber f is created with value 30.
|
||||
BigNumber g = "2060"; //BigNumber g is created with value 2060.
|
||||
BigNumber h(22); //BigNumber h is created with value 22.
|
||||
|
||||
|
||||
## Methods
|
||||
### `add(BigNumber other)`
|
||||
Adds another BigNumber to the current instance
|
||||
|
||||
`BigNumber("4").add(BigNumber("20")) => BigNumber("24")`
|
||||
|
||||
### `subtract(BigNumber other)`
|
||||
Subtracts another BigNumber from the current instance
|
||||
|
||||
`BigNumber("30").subtract(BigNumber("45")) => BigNumber("-15")`
|
||||
|
||||
### `multiply(BigNumber other)`
|
||||
Multiplies the BigNumber by another BigNumber
|
||||
|
||||
`BigNumber("12").multiply(BigNumber("4")) => BigNumber("48")`
|
||||
|
||||
### `divide(BigNumber other)`
|
||||
Divides the BigNumber by another BigNumber
|
||||
|
||||
`BigNumber("30").divide(BigNumber("5")) => BigNumber("6")`
|
||||
|
||||
### `pow(int exponent)`
|
||||
Raises the BigNumber to the power of the exponent
|
||||
|
||||
`BigNumber("2").pow(3) => BigNumber("8")`
|
||||
|
||||
### `getString()`
|
||||
Returns the BigNumber as an std::string
|
||||
|
||||
`BigNumber("3824").getString() => "3824"`
|
||||
|
||||
### `setString(std::string newStr)`
|
||||
Sets the BigNumber's internal number string to a new string
|
||||
|
||||
`BigNumber("2847").setString("38") => BigNumber("38")`
|
||||
|
||||
### `negate()`
|
||||
Changes the sign of the BigNumber
|
||||
|
||||
BigNumber("3").negate() => BigNumber("-3")
|
||||
BigNumber("-27").negate() => BigNumber("27")
|
||||
|
||||
### `equals(BigNumber other)`
|
||||
Checks if the other BigNumber is equal to this one
|
||||
|
||||
`BigNumber("24").equals(BigNumber("28")) => false`
|
||||
|
||||
### `digits()`
|
||||
Returns the number of digits in the BigNumber
|
||||
|
||||
`BigNumber("28374").digits() => 5`
|
||||
|
||||
### `isNegative()`
|
||||
Determines whether a BigNumber is negative
|
||||
|
||||
`BigNumber("-278").isNegative() => true`
|
||||
|
||||
### `isPositive()`
|
||||
Determines whether a BigNumber is positive
|
||||
|
||||
`BigNumber("-3").isPositive() => false`
|
||||
|
||||
### `isEven()`
|
||||
Determines whether a BigNumber is even
|
||||
|
||||
`BigNumber("28472310").isEven() => true`
|
||||
|
||||
### `isOdd()`
|
||||
Determines whether a BigNumber is odd
|
||||
|
||||
`BigNumber("283427").isOdd() => true`
|
||||
|
||||
### `abs()`
|
||||
Gets the absolute value of the BigNumber
|
||||
|
||||
`BigNumber("-26").abs() => BigNumber("26")`
|
||||
|
||||
|
||||
## Operator overloads
|
||||
The following operators have been overloaded to work with BigNumbers:
|
||||
|
||||
### `<<`
|
||||
Output stream operator
|
||||
|
||||
`std::cout << BigNumber("26") << std::endl => 26`
|
||||
|
||||
### `+`
|
||||
Addition operator
|
||||
|
||||
`BigNumber("2") + BigNumber("4") => BigNumber("6")`
|
||||
|
||||
### `-`
|
||||
Subtraction operator
|
||||
|
||||
`BigNumber("0") - BigNumber("2000") => BigNumber("-2000")`
|
||||
|
||||
### `*`
|
||||
Multiplication operator
|
||||
|
||||
`BigNumber("-20") * BigNumber("-5") => BigNumber("100")`
|
||||
|
||||
### `/`
|
||||
Division operator
|
||||
|
||||
`BigNumber("10") / BigNumber("-2") => BigNumber("-5")`
|
||||
|
||||
### `==`
|
||||
Equal to operator
|
||||
|
||||
`BigNumber("24") == BigNumber("24") => true`
|
||||
|
||||
### `>`
|
||||
Greater than operator
|
||||
|
||||
`BigNumber("2") > BigNumber("6") => false`
|
||||
|
||||
### `<`
|
||||
Less than operator
|
||||
|
||||
`BigNumber("2") < BigNumber("6") => true`
|
||||
|
||||
### `>=`
|
||||
Greater than or equal to operator
|
||||
|
||||
`BigNumber("34") >= BigNumber("22") => true`
|
||||
|
||||
### `<=`
|
||||
Less than or equal to operator
|
||||
|
||||
`BigNumber("383") <= BigNumber("383") => true`
|
||||
|
||||
### `=`
|
||||
Assignment operator
|
||||
|
||||
`BigNumber c("3") = BigNumber("8") => BigNumber("8")`
|
||||
|
||||
### `+=`
|
||||
Adds and assigns to the BigNumber
|
||||
|
||||
`BigNumber c("4") += BigNumber("3") => BigNumber("7")`
|
||||
|
||||
### `-=`
|
||||
Subtracts and assigns to the BigNumber
|
||||
|
||||
`BigNumber c("28") -= BigNumber("3") => BigNumber("25")`
|
||||
|
||||
### `*=`
|
||||
Multiplies and assigns to the BigNumber
|
||||
|
||||
`BigNumber c("3") *= BigNumber("4") => BigNumber("12")`
|
||||
|
||||
### `/=`
|
||||
Divides and assigns to the BigNumber
|
||||
|
||||
`BigNumber c("30") /= BigNumber("30") => BigNumer("1")`
|
||||
|
||||
### `++ (Prefix)`
|
||||
Increments the BigNumber and returns the newly incremented number
|
||||
|
||||
`++BigNumber("10") => BigNumber("11")`
|
||||
|
||||
### `-- (Prefix)`
|
||||
Decrements the BigNumber and returns the newly decremented number
|
||||
|
||||
`--BigNumber("34") => BigNumber("33")`
|
||||
|
||||
### `++ (Postfix)`
|
||||
Increments the BigNumber but returns the original value
|
||||
|
||||
`BigNumber("20")++ => BigNumber("20")`
|
||||
|
||||
### `-- (Postfix)`
|
||||
Decrements the BigNumber but returns the original value
|
||||
|
||||
`BigNumber("14")-- => BigNumber("14")`
|
||||
|
||||
### `[]`
|
||||
Indexing operator
|
||||
|
||||
`BigNumber d("26")[1] => 6`
|
||||
|
||||
## License
|
||||
This project is under the [Apache License](https://github.com/Limeoats/BigNumber/blob/master/LICENSE.md).
|
||||
|
||||
## Credit
|
||||
The BigNumber class was created by [Mark Guerra](http://www.twitter.com/Limeoats). Visit
|
||||
[Limeoats.com](http://www.limeoats.com) for more information.
|
||||
+360
@@ -0,0 +1,360 @@
|
||||
/*
|
||||
* The MIT License (MIT)
|
||||
*
|
||||
* Copyright (c) 2015 Mark Guerra
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a copy of this
|
||||
* software and associated documentation files (the "Software"), to deal in the Software
|
||||
* without restriction, including without limitation the rights to use, copy, modify, merge,
|
||||
* publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons
|
||||
* to whom the Software is furnished to do so, subject to the following conditions:
|
||||
*
|
||||
* The above copyright notice and this permission notice shall be included in all copies or
|
||||
* substantial portions of the Software.
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
|
||||
* INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE
|
||||
* AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
|
||||
* DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF
|
||||
* OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||
*/
|
||||
|
||||
#ifndef BIGNUMBER_H
|
||||
#define BIGNUMBER_H
|
||||
|
||||
#include <vector>
|
||||
#include <string>
|
||||
#include <iostream>
|
||||
|
||||
/**
|
||||
* BigNumber class
|
||||
*/
|
||||
class BigNumber {
|
||||
public:
|
||||
//@{
|
||||
/**
|
||||
* BigNumber constructor
|
||||
* @param number - The initial value of the BigNumber
|
||||
*/
|
||||
BigNumber(std::string number);
|
||||
BigNumber(long long number);
|
||||
//@}
|
||||
|
||||
/**
|
||||
* Add another BigNumber to the current instance
|
||||
* @param other - The other BigNumber
|
||||
* @return The sum of the two BigNumbers
|
||||
*/
|
||||
BigNumber add(BigNumber other);
|
||||
|
||||
/**
|
||||
* Subtract another BigNumber from the current instance
|
||||
* @param other - The other BigNumber
|
||||
* @return The difference of the two BigNumbers
|
||||
*/
|
||||
BigNumber subtract(BigNumber other);
|
||||
|
||||
/**
|
||||
* Multiply the current instance by another BigNumber
|
||||
* @param other - The other BigNumber
|
||||
* @return The product of the two BigNumbers
|
||||
*/
|
||||
BigNumber multiply(BigNumber other);
|
||||
|
||||
/**
|
||||
* Divide the current instance by another BigNumber
|
||||
* @param other - The other BigNumber
|
||||
* @return The quotient of the two BigNumbers
|
||||
*/
|
||||
BigNumber divide(BigNumber other);
|
||||
|
||||
/**
|
||||
* Raise the current instance to the power of an exponent
|
||||
* @param exponent - The power to be raised by
|
||||
* @return - The resulting BigNumber after exponentiation
|
||||
*/
|
||||
BigNumber pow(int exponent);
|
||||
|
||||
/**
|
||||
* Get the string value of the current instance
|
||||
* @return The BigNumber as a string
|
||||
*/
|
||||
std::string getString();
|
||||
|
||||
/**
|
||||
* Set the value of the current instance with a string
|
||||
* @param newStr - The new value for the BigNumber
|
||||
* @return The BigNumber with the new value
|
||||
*/
|
||||
BigNumber setString(const std::string &newStr);
|
||||
|
||||
/**
|
||||
* Negates the current instance
|
||||
* @return The BigNumber after negation
|
||||
*/
|
||||
BigNumber negate();
|
||||
|
||||
BigNumber trimLeadingZeros();
|
||||
|
||||
//@{
|
||||
/**
|
||||
* Check if another BigNumber is equal to the current instance
|
||||
* @param other - The other BigNumber
|
||||
* @return True if equal, otherwise false
|
||||
*/
|
||||
bool equals(const BigNumber &other);
|
||||
bool equals(const long long &other);
|
||||
bool equals(const std::string &other);
|
||||
//@}
|
||||
|
||||
/**
|
||||
* Get the number of digits in the current instance
|
||||
* @return The number of digits
|
||||
*/
|
||||
unsigned int digits();
|
||||
|
||||
/**
|
||||
* Get whether or not the current instance is a negative number
|
||||
* @return True if negative, otherwise false
|
||||
*/
|
||||
bool isNegative() const;
|
||||
|
||||
/**
|
||||
* Get whether or not the current instance is a positive number
|
||||
* @return True if positive, otherwise false
|
||||
*/
|
||||
bool isPositive();
|
||||
|
||||
/**
|
||||
* Get whether or not the current instance is an even number
|
||||
* @return True if even, otherwise false
|
||||
*/
|
||||
bool isEven();
|
||||
|
||||
/**
|
||||
* Get whether or not the current instance is an odd number
|
||||
* @return True if odd, otherwise false
|
||||
*/
|
||||
bool isOdd();
|
||||
|
||||
/**
|
||||
* Get the absolute value of the current instance
|
||||
* @return The absolute value of the BigNumber
|
||||
*/
|
||||
BigNumber abs() const;
|
||||
|
||||
/**
|
||||
* Output stream operator
|
||||
* @param os The output stream
|
||||
* @param num The current instance
|
||||
* @return The output stream with the current instance
|
||||
*/
|
||||
friend std::ostream &operator<<(std::ostream &os, const BigNumber &num);
|
||||
|
||||
//@{
|
||||
/**
|
||||
* Addition operator
|
||||
* @param b1 - The current instance
|
||||
* @param b2 - The number being added
|
||||
* @return The sum of the two numbers
|
||||
*/
|
||||
friend BigNumber operator+(BigNumber b1, const BigNumber &b2);
|
||||
friend BigNumber operator+(BigNumber b1, const long long &b2);
|
||||
friend BigNumber operator+(BigNumber b1, const std::string &b2);
|
||||
//@}
|
||||
|
||||
//@{
|
||||
/**
|
||||
* Subtraction operator
|
||||
* @param b1 - The current instance
|
||||
* @param b2 - The number being subtracted
|
||||
* @return The difference of the two numbers
|
||||
*/
|
||||
friend BigNumber operator-(BigNumber b1, const BigNumber &b2);
|
||||
friend BigNumber operator-(BigNumber b1, const long long &b2);
|
||||
friend BigNumber operator-(BigNumber b1, const std::string &b2);
|
||||
//@}
|
||||
|
||||
//@{
|
||||
/**
|
||||
* Multiplication operator
|
||||
* @param b1 - The current instance
|
||||
* @param b2 - The number being multiplied by
|
||||
* @return The product of the two numbers
|
||||
*/
|
||||
friend BigNumber operator*(BigNumber b1, const BigNumber &b2);
|
||||
friend BigNumber operator*(BigNumber b1, const long long &b2);
|
||||
friend BigNumber operator*(BigNumber b1, const std::string &b2);
|
||||
//@}
|
||||
|
||||
//@{
|
||||
/**
|
||||
* Division operator
|
||||
* @param b1 - The current instance
|
||||
* @param b2 - The number being divided by
|
||||
* @return The quotient of the two numbers
|
||||
*/
|
||||
friend BigNumber operator/(BigNumber b1, const BigNumber &b2);
|
||||
friend BigNumber operator/(BigNumber b1, const long long &b2);
|
||||
friend BigNumber operator/(BigNumber b1, const std::string &b2);
|
||||
//@}
|
||||
|
||||
/**
|
||||
* Exponent operator
|
||||
* @param b1 - The current instance
|
||||
* @param b2 - The exponent
|
||||
* @return The value after exponentiation
|
||||
*/
|
||||
friend BigNumber operator^(BigNumber b1, const int &b2);
|
||||
|
||||
//@{
|
||||
/**
|
||||
* Equality operator
|
||||
* @param b1 - The current instance
|
||||
* @param b2 - Another value
|
||||
* @return True if equal, otherwise false
|
||||
*/
|
||||
friend bool operator==(BigNumber b1, const BigNumber &b2);
|
||||
friend bool operator==(BigNumber b1, const long long &b2);
|
||||
friend bool operator==(BigNumber b1, const std::string &b2);
|
||||
//@}
|
||||
|
||||
/**
|
||||
* Greater-than operator
|
||||
* @param b1 - The current instance
|
||||
* @param b2 - Another BigNumber
|
||||
* @return True if current instance is greater, otherwise false
|
||||
*/
|
||||
friend bool operator>(BigNumber b1, const BigNumber &b2);
|
||||
|
||||
/**
|
||||
* Less-than operator
|
||||
* @param b1 - The current instance
|
||||
* @param b2 - Another BigNumber
|
||||
* @return True if current instance is less, otherwise false
|
||||
*/
|
||||
friend bool operator<(BigNumber b1, const BigNumber &b2);
|
||||
|
||||
/**
|
||||
* Greater-than or equal-to operator
|
||||
* @param b1 - The current instance
|
||||
* @param b2 - Another BigNumber
|
||||
* @return True if current instance is greater or equal, otherwise false
|
||||
*/
|
||||
friend bool operator>=(BigNumber b1, const BigNumber &b2);
|
||||
|
||||
/**
|
||||
* Less-than or equal-to operator
|
||||
* @param b1 - The current instance
|
||||
* @param b2 - Another BigNumber
|
||||
* @return True if current instance is less or equal, otherwise false
|
||||
*/
|
||||
friend bool operator<=(BigNumber b1, const BigNumber &b2);
|
||||
|
||||
//@{
|
||||
/**
|
||||
* Assignment operator
|
||||
* @param other - The new value for the BigNumber
|
||||
* @return A BigNumber containing the new value
|
||||
*/
|
||||
BigNumber& operator=(const BigNumber &other);
|
||||
BigNumber& operator=(const long long &other);
|
||||
BigNumber& operator=(const std::string &other);
|
||||
//@}
|
||||
|
||||
//@{
|
||||
/**
|
||||
* Addition assignment operator\n
|
||||
* Adds and assigns a value to the current instance
|
||||
* @param other - The value being added
|
||||
* @return The new value after addition and assignment
|
||||
*/
|
||||
BigNumber& operator+=(const BigNumber &other);
|
||||
BigNumber& operator+=(const long long &other);
|
||||
BigNumber& operator+=(const std::string &other);
|
||||
//@}
|
||||
|
||||
//@{
|
||||
/**
|
||||
* Subtraction assignment operator\n
|
||||
* Subtracts and assigns a value to the current instance
|
||||
* @param other - The value being subtracted
|
||||
* @return The new value after subtraction and assignment
|
||||
*/
|
||||
BigNumber& operator-=(const BigNumber &other);
|
||||
BigNumber& operator-=(const long long &other);
|
||||
BigNumber& operator-=(const std::string &other);
|
||||
//@}
|
||||
|
||||
//@{
|
||||
/**
|
||||
* Multiplication assignment operator\n
|
||||
* Multiplies and assigns a value to the current instance
|
||||
* @param other - The value being multiplied
|
||||
* @return The new value after multiplication and assignment
|
||||
*/
|
||||
BigNumber& operator*=(const BigNumber &other);
|
||||
BigNumber& operator*=(const long long &other);
|
||||
BigNumber& operator*=(const std::string &other);
|
||||
//@}
|
||||
|
||||
//@{
|
||||
/**
|
||||
* Division assignment operator\n
|
||||
* Divides and assigns a value to the current instance
|
||||
* @param other - The value being divided
|
||||
* @return The new value after division and assignment
|
||||
*/
|
||||
BigNumber& operator/=(const BigNumber &other);
|
||||
BigNumber& operator/=(const long long &other);
|
||||
BigNumber& operator/=(const std::string &other);
|
||||
//@}
|
||||
|
||||
/**
|
||||
* Pre-increment operator
|
||||
* @return The incremented BigNumber
|
||||
*/
|
||||
BigNumber& operator++();
|
||||
|
||||
/**
|
||||
* Pre-decrement operator
|
||||
* @return The decremented BigNumber
|
||||
*/
|
||||
BigNumber& operator--();
|
||||
|
||||
/**
|
||||
* Post-increment operator
|
||||
* @return The incremented BigNumber
|
||||
*/
|
||||
BigNumber operator++(int);
|
||||
|
||||
/**
|
||||
* Post-decrement operator
|
||||
* @return The decremented BigNumber
|
||||
*/
|
||||
BigNumber operator--(int);
|
||||
|
||||
/**
|
||||
* The index operator
|
||||
* @param index The position being looked at
|
||||
* @return The number at the specified position in the BigNumber string
|
||||
*/
|
||||
unsigned int operator[](int index);
|
||||
|
||||
private:
|
||||
std::string _numberString; //The big number represented as a string
|
||||
|
||||
//Methods
|
||||
BigNumber addll(const long long &other);
|
||||
BigNumber addstr(const std::string &other);
|
||||
BigNumber subtractll(const long long &other);
|
||||
BigNumber subtractstr(const std::string &other);
|
||||
BigNumber multiplyll(const long long &other);
|
||||
BigNumber multiplystr(const std::string &other);
|
||||
BigNumber dividell(const long long &other);
|
||||
BigNumber dividestr(const std::string &other);
|
||||
};
|
||||
|
||||
|
||||
|
||||
#endif
|
||||
Vendored
+192
@@ -0,0 +1,192 @@
|
||||
////////////////////////////
|
||||
//To make sure assert works:
|
||||
#ifdef NDEBUG
|
||||
#undef NDEBUG
|
||||
#endif
|
||||
////////////////////////////
|
||||
|
||||
#include "src/bignumber.h"
|
||||
#include <assert.h>
|
||||
|
||||
int main() {
|
||||
//Addition
|
||||
assert((BigNumber(50) + BigNumber(32)).getString() == "82");
|
||||
assert((BigNumber(5) + BigNumber(622)).getString() == "627");
|
||||
assert((BigNumber("-33") + BigNumber("8")).getString() == "-25");
|
||||
assert((BigNumber("15535") + BigNumber("0")).getString() == "15535");
|
||||
assert((BigNumber("126") + BigNumber("39285")).getString() == "39411");
|
||||
assert((BigNumber("0") + BigNumber("0")).getString() == "0");
|
||||
assert(BigNumber(5) + 10 == 15);
|
||||
assert(BigNumber("-41") + 40 == -1);
|
||||
BigNumber ad1(600);
|
||||
ad1 += 50;
|
||||
ad1 += "50";
|
||||
assert(ad1.getString() == "700");
|
||||
assert(ad1 == 700);
|
||||
|
||||
//Subtraction
|
||||
assert((BigNumber("50") - BigNumber("32")).getString() == "18");
|
||||
assert((BigNumber("50") - BigNumber("60")).getString() == "-10");
|
||||
assert((BigNumber("0") - BigNumber("46")).getString() == "-46");
|
||||
assert((BigNumber("50") - BigNumber("50")).getString() == "0");
|
||||
assert((BigNumber("482847") - BigNumber("89787941")).getString() == "-89305094");
|
||||
assert((BigNumber("6828") - BigNumber("1")).getString() == "6827");
|
||||
assert((BigNumber("100") - BigNumber("50")).getString() == "50");
|
||||
assert((BigNumber("42") - BigNumber("49")).getString() == "-7");
|
||||
assert((BigNumber("100") - BigNumber("5")) == 95);
|
||||
BigNumber sb1 = 200;
|
||||
sb1 -= 40;
|
||||
assert(sb1 == 160);
|
||||
sb1 = sb1 - 180;
|
||||
assert(sb1 == "-20");
|
||||
sb1 -= "20";
|
||||
assert(sb1 == BigNumber(-40));
|
||||
|
||||
//Multiplication
|
||||
assert((BigNumber("4") * BigNumber("12")).getString() == "48");
|
||||
assert((BigNumber("3002") * BigNumber("1")).getString() == "3002");
|
||||
assert((BigNumber("99") * BigNumber("0")).getString() == "0");
|
||||
assert((BigNumber("-5") * BigNumber("5")).getString() == "-25");
|
||||
assert((BigNumber("-33") * BigNumber("-2")).getString() == "66");
|
||||
assert((BigNumber("283") * BigNumber("382871")).getString() == "108352493");
|
||||
BigNumber ml1 = 4;
|
||||
ml1 *= 6;
|
||||
assert(ml1 == "24");
|
||||
ml1 = BigNumber(5) * 6;
|
||||
assert(ml1 == 30);
|
||||
ml1 *= "5000";
|
||||
assert(ml1 == 150000);
|
||||
|
||||
//Division
|
||||
assert(BigNumber("25").divide(BigNumber("5")) == 5);
|
||||
assert(BigNumber("48").divide(BigNumber("6")) == 8);
|
||||
assert(BigNumber("100").divide(BigNumber("5")) == 20);
|
||||
BigNumber dv1 = 100;
|
||||
dv1 /= 25;
|
||||
assert(dv1 == 4);
|
||||
dv1 = dv1 / dv1;
|
||||
assert(dv1 == 1);
|
||||
dv1 /= 1;
|
||||
assert(dv1 == 1);
|
||||
dv1 = -5;
|
||||
dv1 /= 5;
|
||||
assert(dv1 == -1);
|
||||
dv1 = 3000;
|
||||
dv1 /= 300;
|
||||
assert(dv1 == 10);
|
||||
dv1 = 25485;
|
||||
dv1 /= 5;
|
||||
assert(dv1 == "5097");
|
||||
|
||||
//Exponentiation
|
||||
assert((BigNumber("2").pow(3)).getString() == "8");
|
||||
assert((BigNumber("1").pow(38)).getString() == "1");
|
||||
assert((BigNumber("5").pow(2)).getString() == "25");
|
||||
assert((BigNumber("10").pow(10)).getString() == "10000000000");
|
||||
assert((BigNumber("5").pow(1)).getString() == "5");
|
||||
assert((BigNumber("5").pow(0)).getString() == "1");
|
||||
assert((BigNumber("-5").pow(2)).getString() == "25");
|
||||
|
||||
//Equals
|
||||
assert(BigNumber("4") == BigNumber("4"));
|
||||
assert(BigNumber("-3") == BigNumber("-3"));
|
||||
assert(BigNumber("0") == BigNumber("0"));
|
||||
assert(BigNumber("938283828178273") == BigNumber("938283828178273"));
|
||||
|
||||
//Greater than
|
||||
assert(BigNumber("5") > BigNumber("2"));
|
||||
assert(BigNumber("30") > BigNumber("-40"));
|
||||
assert(BigNumber("-5") > BigNumber("-10"));
|
||||
assert(BigNumber("0") > BigNumber("-1"));
|
||||
|
||||
//Less than
|
||||
assert(BigNumber("10") < BigNumber("20"));
|
||||
assert(BigNumber("-5") < BigNumber("0"));
|
||||
assert(BigNumber("30") < BigNumber("30000"));
|
||||
|
||||
//Greater than or equal to
|
||||
assert(BigNumber("5") >= BigNumber("0"));
|
||||
assert(BigNumber("-5") >= BigNumber("-5"));
|
||||
assert(BigNumber("-5") >= BigNumber("-10"));
|
||||
assert(BigNumber("0") >= BigNumber("0"));
|
||||
assert(BigNumber("32") >= BigNumber("-32"));
|
||||
assert(BigNumber("2") >= BigNumber("0001"));
|
||||
|
||||
//Less than or equal to
|
||||
assert(BigNumber("5") <= BigNumber("10"));
|
||||
assert(BigNumber("0") <= BigNumber("0"));
|
||||
assert(BigNumber("-5") <= BigNumber("0"));
|
||||
assert(BigNumber("30") <= BigNumber("30"));
|
||||
assert(BigNumber("400") <= BigNumber("392342"));
|
||||
|
||||
//Index
|
||||
assert(BigNumber("423")[1] == 2);
|
||||
assert(BigNumber("0")[0] == 0);
|
||||
assert(BigNumber("-5")[1] == 5);
|
||||
|
||||
//Even
|
||||
assert(BigNumber("426").isEven());
|
||||
assert(BigNumber("-20").isEven());
|
||||
|
||||
//Odd
|
||||
assert(BigNumber("83").isOdd());
|
||||
assert(BigNumber("-27").isOdd());
|
||||
|
||||
//Positive
|
||||
assert(BigNumber("38").isPositive());
|
||||
|
||||
//Negative
|
||||
assert(BigNumber("-28382").isNegative());
|
||||
|
||||
//Increment/Decrement operators
|
||||
assert(BigNumber("5")--.getString() == "5");
|
||||
assert((--BigNumber("5")).getString() == "4");
|
||||
assert(BigNumber("10")++.getString() == "10");
|
||||
assert((++BigNumber("10")).getString() == "11");
|
||||
|
||||
BigNumber a("10");
|
||||
a++;
|
||||
assert(a.getString() == "11");
|
||||
++a;
|
||||
assert(a.getString() == "12");
|
||||
a--;
|
||||
assert(a.getString() == "11");
|
||||
--a;
|
||||
assert(a.getString() == "10");
|
||||
|
||||
//Absolute value
|
||||
assert(BigNumber("45").abs().getString() == "45");
|
||||
assert(BigNumber("-325").abs().getString() == "325");
|
||||
|
||||
//Digits
|
||||
assert(BigNumber("28374765").digits() == 8);
|
||||
assert(BigNumber("-3092").digits() == 4);
|
||||
|
||||
//Set string
|
||||
assert(BigNumber("234").setString("-45").getString() == "-45");
|
||||
|
||||
//Assignment operator
|
||||
BigNumber c(10);
|
||||
c = 5;
|
||||
assert(c == 5);
|
||||
assert(c == BigNumber(5));
|
||||
assert(c == BigNumber("5"));
|
||||
c = "83833";
|
||||
assert(c == 83833);
|
||||
assert(c == BigNumber(83833));
|
||||
assert(c == BigNumber("83833"));
|
||||
|
||||
//Equals testing
|
||||
BigNumber d(40);
|
||||
assert(d == 40);
|
||||
assert(d == "40");
|
||||
assert(d == BigNumber("40"));
|
||||
assert(d == BigNumber(40));
|
||||
d = 40;
|
||||
assert(d == 40);
|
||||
d = "40";
|
||||
assert(d == 40);
|
||||
|
||||
|
||||
std::cout << "BigNumber ran successfully." << std::endl;
|
||||
}
|
||||
Vendored
+609
@@ -0,0 +1,609 @@
|
||||
/*
|
||||
* The MIT License (MIT)
|
||||
*
|
||||
* Copyright (c) 2015 Mark Guerra
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a copy of this
|
||||
* software and associated documentation files (the "Software"), to deal in the Software
|
||||
* without restriction, including without limitation the rights to use, copy, modify, merge,
|
||||
* publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons
|
||||
* to whom the Software is furnished to do so, subject to the following conditions:
|
||||
*
|
||||
* The above copyright notice and this permission notice shall be included in all copies or
|
||||
* substantial portions of the Software.
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
|
||||
* INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE
|
||||
* AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
|
||||
* DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF
|
||||
* OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||
*/
|
||||
|
||||
#include <sstream>
|
||||
#include <stack>
|
||||
#include <iostream>
|
||||
|
||||
#include "bignumber.h"
|
||||
|
||||
|
||||
BigNumber::BigNumber(std::string number) :
|
||||
_numberString(number)
|
||||
{
|
||||
}
|
||||
|
||||
BigNumber::BigNumber(long long number) :
|
||||
_numberString(std::to_string(number))
|
||||
{}
|
||||
|
||||
BigNumber BigNumber::add(BigNumber other) {
|
||||
BigNumber b1 = other > *this ? other : *this;
|
||||
BigNumber b2 = other > *this ? *this : other;
|
||||
if (b1.isNegative() || b2.isNegative()) {
|
||||
if (b1.isNegative() && b2.isNegative()) {
|
||||
return b1.negate().add(b2.negate()).negate();
|
||||
}
|
||||
else if (b1.isNegative() && !b2.isNegative()) {
|
||||
return b1.negate().subtract(b2).negate();
|
||||
}
|
||||
else {
|
||||
return b2.negate().subtract(b1).negate();
|
||||
}
|
||||
}
|
||||
std::string results;
|
||||
int carry = 0;
|
||||
int diff = int(b1._numberString.size() - b2._numberString.size());
|
||||
for (int i = 0; i < diff; ++i) {
|
||||
b2._numberString.insert(b2._numberString.begin(), '0');
|
||||
}
|
||||
for (int i = int(b1._numberString.size() - 1); i >= 0; --i) {
|
||||
int sum = (b1._numberString[i] - '0') + (b2._numberString[i] - '0') + carry;
|
||||
carry = 0;
|
||||
if (sum <= 9 || i == 0) {
|
||||
results.insert(0, std::to_string(sum));
|
||||
}
|
||||
else {
|
||||
results.insert(0, std::to_string(sum % 10));
|
||||
carry = 1;
|
||||
}
|
||||
}
|
||||
return BigNumber(results);
|
||||
}
|
||||
|
||||
BigNumber BigNumber::addll(const long long &other) {
|
||||
return this->add(BigNumber(other));
|
||||
}
|
||||
|
||||
BigNumber BigNumber::addstr(const std::string &other) {
|
||||
return this->add(BigNumber(other));
|
||||
}
|
||||
|
||||
|
||||
BigNumber BigNumber::subtract(BigNumber other) {
|
||||
BigNumber b1 = *this, b2 = other;
|
||||
if (b1.isNegative() || b2.isNegative()) {
|
||||
if (b1.isNegative() && b2.isNegative()) {
|
||||
return b1.negate().add(b2.negate()).negate();
|
||||
}
|
||||
else if (b1.isNegative() && !b2.isNegative()) {
|
||||
return b1.negate().add(b2).negate();
|
||||
}
|
||||
else {
|
||||
return b2.negate().add(b1);
|
||||
}
|
||||
}
|
||||
std::string results;
|
||||
int n = 0, p = 0;
|
||||
bool takeOffOne = false;
|
||||
bool shouldBeTen = false;
|
||||
|
||||
if (b1 < b2) {
|
||||
//Negative answer
|
||||
std::string t = b2.subtract(*this).negate().getString();
|
||||
for (unsigned int i = 1; i < t.length(); ++i) {
|
||||
if (t[i] != '0') break;
|
||||
t.erase(1, 1);
|
||||
}
|
||||
return BigNumber(t);
|
||||
}
|
||||
|
||||
//This next if-block fixes the case where the digit difference is greater than 1
|
||||
//100 - 5 is an example. This code adds 0's to make it, for example, 100 - 05, which
|
||||
//allows the rest of the subtraction code to work.
|
||||
if (b1._numberString.size() - b2.getString().size() > 1) {
|
||||
for (unsigned long i = 0; i < b1._numberString.size() - b2.getString().size() - 1; ++i) {
|
||||
b2._numberString.insert(b2._numberString.begin(), '0');
|
||||
}
|
||||
}
|
||||
int i = int(b1._numberString.size() - 1);
|
||||
for (int j = int(b2._numberString.size() - 1); j >= 0; --j) {
|
||||
if (((b1._numberString[i] - '0') < (b2._numberString[j] - '0')) && i > 0) {
|
||||
n = char((b1._numberString[i] - '0') + 10);
|
||||
takeOffOne = true;
|
||||
if (j > 0 || b1._numberString[i - 1] != '0') {
|
||||
p = char((b1._numberString[i - 1] - '0') - 1);
|
||||
if (p == -1) {
|
||||
p = 9;
|
||||
shouldBeTen = true;
|
||||
}
|
||||
takeOffOne = false;
|
||||
}
|
||||
if (shouldBeTen) {
|
||||
int index = i - 1;
|
||||
for (int a = i - 1; (b1._numberString[a] - '0') == 0; --a) {
|
||||
b1._numberString[a] = static_cast<char>(p + '0');
|
||||
--index;
|
||||
}
|
||||
int t = (b1._numberString[index] - '0') - 1;
|
||||
b1._numberString[index] = static_cast<char>(t + '0');
|
||||
}
|
||||
b1._numberString[i - 1] = static_cast<char>(p + '0');
|
||||
shouldBeTen = false;
|
||||
}
|
||||
std::stringstream ss;
|
||||
if (((b1._numberString[i] - '0') == (b2._numberString[j] - '0'))) {
|
||||
ss << "0";
|
||||
}
|
||||
else {
|
||||
if (n <= 0) {
|
||||
ss << ((b1._numberString[i] - '0') - (b2._numberString[j] - '0'));
|
||||
}
|
||||
else {
|
||||
ss << (n - (b2._numberString[j] - '0'));
|
||||
}
|
||||
}
|
||||
|
||||
results.insert(0, ss.str());
|
||||
--i;
|
||||
n = 0;
|
||||
}
|
||||
if (takeOffOne) {
|
||||
std::string number = "";
|
||||
for (int j = b1._numberString.length() - b2._numberString.length() - 1; j >= 0; --j) {
|
||||
if (b1._numberString[j] == '0') {
|
||||
number += "0";
|
||||
continue;
|
||||
}
|
||||
else {
|
||||
number.insert(number.begin(), b1._numberString[j]);
|
||||
int t = atoi(number.c_str());
|
||||
--t;
|
||||
b1._numberString.replace(0, number.size(), std::to_string(t));
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
while (i >= 0) {
|
||||
std::stringstream ss;
|
||||
if (i == 0) {
|
||||
if (b1._numberString[i] - '0' != 0) {
|
||||
ss << (b1._numberString[i] - '0');
|
||||
results.insert(0, ss.str());
|
||||
}
|
||||
}
|
||||
else {
|
||||
ss << (b1._numberString[i] - '0');
|
||||
results.insert(0, ss.str());
|
||||
}
|
||||
|
||||
--i;
|
||||
}
|
||||
//In the case of all 0's, we only want to return one of them
|
||||
if (results.find_first_not_of('0') == std::string::npos) {
|
||||
results = "0";
|
||||
}
|
||||
else if (results[0] == '0') {
|
||||
int index = results.find_first_not_of('0');
|
||||
results = results.substr(index, results.length() - 1);
|
||||
}
|
||||
return BigNumber(results);
|
||||
}
|
||||
|
||||
BigNumber BigNumber::subtractll(const long long &other) {
|
||||
return this->subtract(BigNumber(other));
|
||||
}
|
||||
|
||||
BigNumber BigNumber::subtractstr(const std::string &other) {
|
||||
return this->subtract(BigNumber(other));
|
||||
}
|
||||
|
||||
BigNumber BigNumber::multiply(BigNumber other) {
|
||||
BigNumber b1 = other > *this ? other : *this;
|
||||
BigNumber b2 = other > *this ? *this : other;
|
||||
if (b1.isNegative() || b2.isNegative()) {
|
||||
if (b1.isNegative() && b2.isNegative()) {
|
||||
return b1.negate().multiply(b2.negate());
|
||||
}
|
||||
else if (b1.isNegative() && !b2.isNegative()) {
|
||||
return b1.negate().multiply(b2).negate();
|
||||
}
|
||||
else {
|
||||
return b2.negate().multiply(b1).negate();
|
||||
}
|
||||
}
|
||||
if (b1 == 0 || b2 == 0) return 0;
|
||||
int carry = 0;
|
||||
int zeroCounter = 0;
|
||||
BigNumber b = 0;
|
||||
|
||||
for (unsigned int i = 0; i < b1._numberString.size() - b2._numberString.size(); ++i) {
|
||||
b2._numberString.insert(b2._numberString.begin(), '0');
|
||||
}
|
||||
for (long long int i = (b2._numberString.size() - 1); i >= 0; --i) {
|
||||
std::string rr;
|
||||
for (long long int j = int(b1._numberString.size() - 1); j >= 0; --j) {
|
||||
int val = ((b2._numberString[i] - '0') * (b1._numberString[j] - '0')) + carry;
|
||||
carry = 0;
|
||||
if (val > 9 && j != 0) {
|
||||
carry = val / 10;
|
||||
rr.insert(0, std::to_string(val % 10));
|
||||
}
|
||||
else {
|
||||
rr.insert(0, std::to_string(val));
|
||||
}
|
||||
}
|
||||
if (zeroCounter > 0) {
|
||||
for (int x = 0; x < zeroCounter; ++x) {
|
||||
rr.append("0");
|
||||
}
|
||||
}
|
||||
++zeroCounter;
|
||||
b += BigNumber(rr);
|
||||
}
|
||||
if (b._numberString.find_first_not_of('0') != std::string::npos) {
|
||||
b.setString(b._numberString.erase(0, b._numberString.find_first_not_of('0')));
|
||||
}
|
||||
else {
|
||||
//In the case of all 0's, we only want to return one of them
|
||||
b.setString("0");
|
||||
}
|
||||
return b;
|
||||
}
|
||||
|
||||
BigNumber BigNumber::multiplyll(const long long &other) {
|
||||
if (other == 0)
|
||||
return 0;
|
||||
if (other == 1)
|
||||
return *this;
|
||||
auto original = *this;
|
||||
for (auto i = 0; i < other - 1; ++i) {
|
||||
*this += original;
|
||||
}
|
||||
return *this;
|
||||
}
|
||||
|
||||
BigNumber BigNumber::multiplystr(const std::string &other) {
|
||||
return this->multiply(BigNumber(other));
|
||||
}
|
||||
|
||||
BigNumber BigNumber::divide(BigNumber other) {
|
||||
if (other == 0) {
|
||||
std::cerr << "You cannot divide by 0!" << std::endl;
|
||||
}
|
||||
BigNumber b1 = *this, b2 = other;
|
||||
bool sign = false;
|
||||
if (b1.isNegative() && b2.isNegative()) {
|
||||
b1.negate();
|
||||
b2.negate();
|
||||
}
|
||||
else if (b1.isNegative() && !b2.isNegative()) {
|
||||
b1.negate();
|
||||
sign = true;
|
||||
}
|
||||
else if (!b1.isNegative() && b2.isNegative()) {
|
||||
b2.negate();
|
||||
sign = true;
|
||||
}
|
||||
BigNumber quotient = 0;
|
||||
while (b1 >= b2) {
|
||||
b1 -= b2;
|
||||
++quotient;
|
||||
}
|
||||
if (sign) quotient.negate();
|
||||
return quotient;
|
||||
}
|
||||
|
||||
BigNumber BigNumber::dividell(const long long &other) {
|
||||
return this->divide(BigNumber(other));
|
||||
}
|
||||
|
||||
BigNumber BigNumber::dividestr(const std::string &other) {
|
||||
return this->divide(BigNumber(other));
|
||||
}
|
||||
|
||||
BigNumber BigNumber::pow(int exponent) {
|
||||
if (exponent < 0) std::cerr << "Powers less than 0 are not supported" << std::endl;
|
||||
if (exponent == 0) return BigNumber("1");
|
||||
if (exponent == 1) return *this;
|
||||
BigNumber result = 1, base = *this;
|
||||
while (exponent) {
|
||||
if (exponent & 1) {
|
||||
result *= base;
|
||||
}
|
||||
exponent >>= 1;
|
||||
base *= base;
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
std::string BigNumber::getString() {
|
||||
return this->_numberString;
|
||||
}
|
||||
|
||||
BigNumber BigNumber::setString(const std::string &newStr) {
|
||||
this->_numberString = newStr;
|
||||
return *this;
|
||||
}
|
||||
|
||||
BigNumber BigNumber::negate() {
|
||||
if (this->_numberString[0] == '-') {
|
||||
this->_numberString.erase(0, 1);
|
||||
}
|
||||
else {
|
||||
this->_numberString.insert(this->_numberString.begin(), '-');
|
||||
}
|
||||
return *this;
|
||||
}
|
||||
|
||||
BigNumber BigNumber::trimLeadingZeros() {
|
||||
BigNumber b = *this;
|
||||
if (b._numberString.find_first_not_of('0') != std::string::npos) {
|
||||
b.setString(b._numberString.erase(0, b._numberString.find_first_not_of('0')));
|
||||
}
|
||||
return b;
|
||||
}
|
||||
|
||||
bool BigNumber::equals(const BigNumber &other) {
|
||||
return this->_numberString == other._numberString;
|
||||
}
|
||||
|
||||
bool BigNumber::equals(const long long &other) {
|
||||
return this->getString() == std::to_string(other);
|
||||
}
|
||||
|
||||
bool BigNumber::equals(const std::string &other) {
|
||||
return this->getString() == other;
|
||||
}
|
||||
|
||||
unsigned int BigNumber::digits() {
|
||||
return this->_numberString.length() - static_cast<int>(this->isNegative());
|
||||
}
|
||||
|
||||
bool BigNumber::isNegative() const {
|
||||
return this->_numberString[0] == '-';
|
||||
}
|
||||
|
||||
bool BigNumber::isPositive() {
|
||||
return !this->isNegative();
|
||||
}
|
||||
|
||||
bool BigNumber::isEven() {
|
||||
return this->_numberString[this->_numberString.length() - 1] % 2 == 0;
|
||||
}
|
||||
|
||||
bool BigNumber::isOdd() {
|
||||
return !this->isEven();
|
||||
}
|
||||
|
||||
BigNumber BigNumber::abs() const {
|
||||
return BigNumber(this->_numberString.substr(static_cast<unsigned int>(this->isNegative())));
|
||||
}
|
||||
|
||||
std::ostream &operator<<(std::ostream &os, const BigNumber &num) {
|
||||
os << num._numberString;
|
||||
return os;
|
||||
}
|
||||
|
||||
BigNumber operator+(BigNumber b1, const BigNumber &b2) {
|
||||
return b1.add(b2);
|
||||
}
|
||||
|
||||
BigNumber operator+(BigNumber b1, const long long &b2) {
|
||||
return b1.addll(b2);
|
||||
}
|
||||
|
||||
BigNumber operator+(BigNumber b1, const std::string &b2) {
|
||||
return b1.addstr(b2);
|
||||
}
|
||||
|
||||
BigNumber operator-(BigNumber b1, const BigNumber &b2) {
|
||||
return b1.subtract(b2);
|
||||
}
|
||||
|
||||
BigNumber operator-(BigNumber b1, const long long &b2) {
|
||||
return b1.subtractll(b2);
|
||||
}
|
||||
|
||||
BigNumber operator-(BigNumber b1, const std::string &b2) {
|
||||
return b1.subtractstr(b2);
|
||||
}
|
||||
|
||||
BigNumber operator*(BigNumber b1, const BigNumber &b2) {
|
||||
return b1.multiply(b2);
|
||||
}
|
||||
|
||||
BigNumber operator*(BigNumber b1, const long long &b2) {
|
||||
return b1.multiplyll(b2);
|
||||
}
|
||||
|
||||
BigNumber operator*(BigNumber b1, const std::string &b2) {
|
||||
return b1.multiplystr(b2);
|
||||
}
|
||||
|
||||
BigNumber operator/(BigNumber b1, const BigNumber &b2) {
|
||||
return b1.divide(b2);
|
||||
}
|
||||
|
||||
BigNumber operator/(BigNumber b1, const long long &b2) {
|
||||
return b1.dividell(b2);
|
||||
}
|
||||
|
||||
BigNumber operator/(BigNumber b1, const std::string &b2) {
|
||||
return b1.dividestr(b2);
|
||||
}
|
||||
|
||||
BigNumber operator^(BigNumber b1, const int &b2) {
|
||||
return b1.pow(b2);
|
||||
}
|
||||
|
||||
bool operator==(BigNumber b1, const BigNumber &b2) {
|
||||
return b1.equals(b2);
|
||||
}
|
||||
|
||||
bool operator==(BigNumber b1, const long long &b2) {
|
||||
return b1.equals(b2);
|
||||
}
|
||||
|
||||
bool operator==(BigNumber b1, const std::string &b2) {
|
||||
return b1.equals(b2);
|
||||
}
|
||||
|
||||
bool operator>(BigNumber b1, const BigNumber &b2) {
|
||||
if (b1.isNegative() || b2.isNegative()) {
|
||||
if (b1.isNegative() && b2.isNegative()) {
|
||||
BigNumber bt = b2;
|
||||
b1._numberString.erase(0, 1);
|
||||
bt._numberString.erase(0, 1);
|
||||
return b1 < bt;
|
||||
}
|
||||
else {
|
||||
return !(b1.isNegative() && !b2.isNegative());
|
||||
}
|
||||
}
|
||||
b1 = b1.trimLeadingZeros();
|
||||
auto c = BigNumber(b2);
|
||||
c = c.trimLeadingZeros();
|
||||
if (b1 == c) {
|
||||
return false;
|
||||
}
|
||||
if (b1._numberString.size() > c._numberString.size()) {
|
||||
return true;
|
||||
}
|
||||
else if (c._numberString.size() > b1._numberString.size()) {
|
||||
return false;
|
||||
}
|
||||
else {
|
||||
for (unsigned int i = 0; i < b1._numberString.size(); ++i) {
|
||||
if (b1[i] == static_cast<unsigned int>(c._numberString[i] - '0')) {
|
||||
continue;
|
||||
}
|
||||
return b1[i] > static_cast<unsigned int>(c._numberString[i] - '0');
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
bool operator<(BigNumber b1, const BigNumber &b2) {
|
||||
return !(b1 == b2) && !(b1 > b2);
|
||||
}
|
||||
|
||||
bool operator>=(BigNumber b1, const BigNumber &b2) {
|
||||
return b1 > b2 || b1 == b2;
|
||||
}
|
||||
|
||||
bool operator<=(BigNumber b1, const BigNumber &b2) {
|
||||
return b1 < b2 || b1 == b2;
|
||||
}
|
||||
|
||||
unsigned int BigNumber::operator[](int index) {
|
||||
if (this->_numberString[index] == '-') {
|
||||
std::cerr << "You cannot get the negative sign from the number" << std::endl;
|
||||
}
|
||||
return static_cast<unsigned int>(this->_numberString[index] - '0');
|
||||
}
|
||||
|
||||
BigNumber& BigNumber::operator=(const BigNumber &other) {
|
||||
this->_numberString = other._numberString;
|
||||
return *this;
|
||||
}
|
||||
|
||||
BigNumber& BigNumber::operator=(const long long &other) {
|
||||
this->_numberString = std::to_string(other);
|
||||
return *this;
|
||||
}
|
||||
|
||||
BigNumber& BigNumber::operator=(const std::string &other) {
|
||||
this->_numberString = other;
|
||||
return *this;
|
||||
}
|
||||
|
||||
BigNumber& BigNumber::operator+=(const BigNumber &other) {
|
||||
*this = *this + other;
|
||||
return *this;
|
||||
}
|
||||
|
||||
BigNumber& BigNumber::operator+=(const long long &other) {
|
||||
*this = *this + other;
|
||||
return *this;
|
||||
}
|
||||
|
||||
BigNumber& BigNumber::operator+=(const std::string &other) {
|
||||
*this = *this + other;
|
||||
return *this;
|
||||
}
|
||||
|
||||
BigNumber& BigNumber::operator-=(const BigNumber &other) {
|
||||
*this = *this - other;
|
||||
return *this;
|
||||
}
|
||||
|
||||
BigNumber& BigNumber::operator-=(const long long &other) {
|
||||
*this = *this - other;
|
||||
return *this;
|
||||
}
|
||||
|
||||
BigNumber& BigNumber::operator-=(const std::string &other) {
|
||||
*this = *this - other;
|
||||
return *this;
|
||||
}
|
||||
|
||||
BigNumber& BigNumber::operator*=(const BigNumber &other) {
|
||||
*this = *this * other;
|
||||
return *this;
|
||||
}
|
||||
|
||||
BigNumber& BigNumber::operator*=(const long long &other) {
|
||||
*this = *this * other;
|
||||
return *this;
|
||||
}
|
||||
|
||||
BigNumber& BigNumber::operator*=(const std::string &other) {
|
||||
*this = *this * other;
|
||||
return *this;
|
||||
}
|
||||
|
||||
BigNumber& BigNumber::operator/=(const BigNumber &other) {
|
||||
*this = *this / other;
|
||||
return *this;
|
||||
}
|
||||
|
||||
BigNumber& BigNumber::operator/=(const long long &other) {
|
||||
*this = *this / other;
|
||||
return *this;
|
||||
}
|
||||
|
||||
BigNumber& BigNumber::operator/=(const std::string &other) {
|
||||
*this = *this / other;
|
||||
return *this;
|
||||
}
|
||||
|
||||
BigNumber& BigNumber::operator++() {
|
||||
*this += BigNumber("1");
|
||||
return *this;
|
||||
}
|
||||
|
||||
BigNumber& BigNumber::operator--() {
|
||||
*this -= BigNumber("1");
|
||||
return *this;
|
||||
}
|
||||
|
||||
BigNumber BigNumber::operator++(int) {
|
||||
BigNumber t(this->getString());
|
||||
++(*this);
|
||||
return t;
|
||||
}
|
||||
|
||||
BigNumber BigNumber::operator--(int) {
|
||||
BigNumber t(this->getString());
|
||||
--(*this);
|
||||
return t;
|
||||
}
|
||||
Vendored
+360
@@ -0,0 +1,360 @@
|
||||
/*
|
||||
* The MIT License (MIT)
|
||||
*
|
||||
* Copyright (c) 2015 Mark Guerra
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a copy of this
|
||||
* software and associated documentation files (the "Software"), to deal in the Software
|
||||
* without restriction, including without limitation the rights to use, copy, modify, merge,
|
||||
* publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons
|
||||
* to whom the Software is furnished to do so, subject to the following conditions:
|
||||
*
|
||||
* The above copyright notice and this permission notice shall be included in all copies or
|
||||
* substantial portions of the Software.
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
|
||||
* INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE
|
||||
* AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
|
||||
* DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF
|
||||
* OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||
*/
|
||||
|
||||
#ifndef BIGNUMBER_H
|
||||
#define BIGNUMBER_H
|
||||
|
||||
#include <vector>
|
||||
#include <string>
|
||||
#include <iostream>
|
||||
|
||||
/**
|
||||
* BigNumber class
|
||||
*/
|
||||
class BigNumber {
|
||||
public:
|
||||
//@{
|
||||
/**
|
||||
* BigNumber constructor
|
||||
* @param number - The initial value of the BigNumber
|
||||
*/
|
||||
BigNumber(std::string number);
|
||||
BigNumber(long long number);
|
||||
//@}
|
||||
|
||||
/**
|
||||
* Add another BigNumber to the current instance
|
||||
* @param other - The other BigNumber
|
||||
* @return The sum of the two BigNumbers
|
||||
*/
|
||||
BigNumber add(BigNumber other);
|
||||
|
||||
/**
|
||||
* Subtract another BigNumber from the current instance
|
||||
* @param other - The other BigNumber
|
||||
* @return The difference of the two BigNumbers
|
||||
*/
|
||||
BigNumber subtract(BigNumber other);
|
||||
|
||||
/**
|
||||
* Multiply the current instance by another BigNumber
|
||||
* @param other - The other BigNumber
|
||||
* @return The product of the two BigNumbers
|
||||
*/
|
||||
BigNumber multiply(BigNumber other);
|
||||
|
||||
/**
|
||||
* Divide the current instance by another BigNumber
|
||||
* @param other - The other BigNumber
|
||||
* @return The quotient of the two BigNumbers
|
||||
*/
|
||||
BigNumber divide(BigNumber other);
|
||||
|
||||
/**
|
||||
* Raise the current instance to the power of an exponent
|
||||
* @param exponent - The power to be raised by
|
||||
* @return - The resulting BigNumber after exponentiation
|
||||
*/
|
||||
BigNumber pow(int exponent);
|
||||
|
||||
/**
|
||||
* Get the string value of the current instance
|
||||
* @return The BigNumber as a string
|
||||
*/
|
||||
std::string getString();
|
||||
|
||||
/**
|
||||
* Set the value of the current instance with a string
|
||||
* @param newStr - The new value for the BigNumber
|
||||
* @return The BigNumber with the new value
|
||||
*/
|
||||
BigNumber setString(const std::string &newStr);
|
||||
|
||||
/**
|
||||
* Negates the current instance
|
||||
* @return The BigNumber after negation
|
||||
*/
|
||||
BigNumber negate();
|
||||
|
||||
BigNumber trimLeadingZeros();
|
||||
|
||||
//@{
|
||||
/**
|
||||
* Check if another BigNumber is equal to the current instance
|
||||
* @param other - The other BigNumber
|
||||
* @return True if equal, otherwise false
|
||||
*/
|
||||
bool equals(const BigNumber &other);
|
||||
bool equals(const long long &other);
|
||||
bool equals(const std::string &other);
|
||||
//@}
|
||||
|
||||
/**
|
||||
* Get the number of digits in the current instance
|
||||
* @return The number of digits
|
||||
*/
|
||||
unsigned int digits();
|
||||
|
||||
/**
|
||||
* Get whether or not the current instance is a negative number
|
||||
* @return True if negative, otherwise false
|
||||
*/
|
||||
bool isNegative() const;
|
||||
|
||||
/**
|
||||
* Get whether or not the current instance is a positive number
|
||||
* @return True if positive, otherwise false
|
||||
*/
|
||||
bool isPositive();
|
||||
|
||||
/**
|
||||
* Get whether or not the current instance is an even number
|
||||
* @return True if even, otherwise false
|
||||
*/
|
||||
bool isEven();
|
||||
|
||||
/**
|
||||
* Get whether or not the current instance is an odd number
|
||||
* @return True if odd, otherwise false
|
||||
*/
|
||||
bool isOdd();
|
||||
|
||||
/**
|
||||
* Get the absolute value of the current instance
|
||||
* @return The absolute value of the BigNumber
|
||||
*/
|
||||
BigNumber abs() const;
|
||||
|
||||
/**
|
||||
* Output stream operator
|
||||
* @param os The output stream
|
||||
* @param num The current instance
|
||||
* @return The output stream with the current instance
|
||||
*/
|
||||
friend std::ostream &operator<<(std::ostream &os, const BigNumber &num);
|
||||
|
||||
//@{
|
||||
/**
|
||||
* Addition operator
|
||||
* @param b1 - The current instance
|
||||
* @param b2 - The number being added
|
||||
* @return The sum of the two numbers
|
||||
*/
|
||||
friend BigNumber operator+(BigNumber b1, const BigNumber &b2);
|
||||
friend BigNumber operator+(BigNumber b1, const long long &b2);
|
||||
friend BigNumber operator+(BigNumber b1, const std::string &b2);
|
||||
//@}
|
||||
|
||||
//@{
|
||||
/**
|
||||
* Subtraction operator
|
||||
* @param b1 - The current instance
|
||||
* @param b2 - The number being subtracted
|
||||
* @return The difference of the two numbers
|
||||
*/
|
||||
friend BigNumber operator-(BigNumber b1, const BigNumber &b2);
|
||||
friend BigNumber operator-(BigNumber b1, const long long &b2);
|
||||
friend BigNumber operator-(BigNumber b1, const std::string &b2);
|
||||
//@}
|
||||
|
||||
//@{
|
||||
/**
|
||||
* Multiplication operator
|
||||
* @param b1 - The current instance
|
||||
* @param b2 - The number being multiplied by
|
||||
* @return The product of the two numbers
|
||||
*/
|
||||
friend BigNumber operator*(BigNumber b1, const BigNumber &b2);
|
||||
friend BigNumber operator*(BigNumber b1, const long long &b2);
|
||||
friend BigNumber operator*(BigNumber b1, const std::string &b2);
|
||||
//@}
|
||||
|
||||
//@{
|
||||
/**
|
||||
* Division operator
|
||||
* @param b1 - The current instance
|
||||
* @param b2 - The number being divided by
|
||||
* @return The quotient of the two numbers
|
||||
*/
|
||||
friend BigNumber operator/(BigNumber b1, const BigNumber &b2);
|
||||
friend BigNumber operator/(BigNumber b1, const long long &b2);
|
||||
friend BigNumber operator/(BigNumber b1, const std::string &b2);
|
||||
//@}
|
||||
|
||||
/**
|
||||
* Exponent operator
|
||||
* @param b1 - The current instance
|
||||
* @param b2 - The exponent
|
||||
* @return The value after exponentiation
|
||||
*/
|
||||
friend BigNumber operator^(BigNumber b1, const int &b2);
|
||||
|
||||
//@{
|
||||
/**
|
||||
* Equality operator
|
||||
* @param b1 - The current instance
|
||||
* @param b2 - Another value
|
||||
* @return True if equal, otherwise false
|
||||
*/
|
||||
friend bool operator==(BigNumber b1, const BigNumber &b2);
|
||||
friend bool operator==(BigNumber b1, const long long &b2);
|
||||
friend bool operator==(BigNumber b1, const std::string &b2);
|
||||
//@}
|
||||
|
||||
/**
|
||||
* Greater-than operator
|
||||
* @param b1 - The current instance
|
||||
* @param b2 - Another BigNumber
|
||||
* @return True if current instance is greater, otherwise false
|
||||
*/
|
||||
friend bool operator>(BigNumber b1, const BigNumber &b2);
|
||||
|
||||
/**
|
||||
* Less-than operator
|
||||
* @param b1 - The current instance
|
||||
* @param b2 - Another BigNumber
|
||||
* @return True if current instance is less, otherwise false
|
||||
*/
|
||||
friend bool operator<(BigNumber b1, const BigNumber &b2);
|
||||
|
||||
/**
|
||||
* Greater-than or equal-to operator
|
||||
* @param b1 - The current instance
|
||||
* @param b2 - Another BigNumber
|
||||
* @return True if current instance is greater or equal, otherwise false
|
||||
*/
|
||||
friend bool operator>=(BigNumber b1, const BigNumber &b2);
|
||||
|
||||
/**
|
||||
* Less-than or equal-to operator
|
||||
* @param b1 - The current instance
|
||||
* @param b2 - Another BigNumber
|
||||
* @return True if current instance is less or equal, otherwise false
|
||||
*/
|
||||
friend bool operator<=(BigNumber b1, const BigNumber &b2);
|
||||
|
||||
//@{
|
||||
/**
|
||||
* Assignment operator
|
||||
* @param other - The new value for the BigNumber
|
||||
* @return A BigNumber containing the new value
|
||||
*/
|
||||
BigNumber& operator=(const BigNumber &other);
|
||||
BigNumber& operator=(const long long &other);
|
||||
BigNumber& operator=(const std::string &other);
|
||||
//@}
|
||||
|
||||
//@{
|
||||
/**
|
||||
* Addition assignment operator\n
|
||||
* Adds and assigns a value to the current instance
|
||||
* @param other - The value being added
|
||||
* @return The new value after addition and assignment
|
||||
*/
|
||||
BigNumber& operator+=(const BigNumber &other);
|
||||
BigNumber& operator+=(const long long &other);
|
||||
BigNumber& operator+=(const std::string &other);
|
||||
//@}
|
||||
|
||||
//@{
|
||||
/**
|
||||
* Subtraction assignment operator\n
|
||||
* Subtracts and assigns a value to the current instance
|
||||
* @param other - The value being subtracted
|
||||
* @return The new value after subtraction and assignment
|
||||
*/
|
||||
BigNumber& operator-=(const BigNumber &other);
|
||||
BigNumber& operator-=(const long long &other);
|
||||
BigNumber& operator-=(const std::string &other);
|
||||
//@}
|
||||
|
||||
//@{
|
||||
/**
|
||||
* Multiplication assignment operator\n
|
||||
* Multiplies and assigns a value to the current instance
|
||||
* @param other - The value being multiplied
|
||||
* @return The new value after multiplication and assignment
|
||||
*/
|
||||
BigNumber& operator*=(const BigNumber &other);
|
||||
BigNumber& operator*=(const long long &other);
|
||||
BigNumber& operator*=(const std::string &other);
|
||||
//@}
|
||||
|
||||
//@{
|
||||
/**
|
||||
* Division assignment operator\n
|
||||
* Divides and assigns a value to the current instance
|
||||
* @param other - The value being divided
|
||||
* @return The new value after division and assignment
|
||||
*/
|
||||
BigNumber& operator/=(const BigNumber &other);
|
||||
BigNumber& operator/=(const long long &other);
|
||||
BigNumber& operator/=(const std::string &other);
|
||||
//@}
|
||||
|
||||
/**
|
||||
* Pre-increment operator
|
||||
* @return The incremented BigNumber
|
||||
*/
|
||||
BigNumber& operator++();
|
||||
|
||||
/**
|
||||
* Pre-decrement operator
|
||||
* @return The decremented BigNumber
|
||||
*/
|
||||
BigNumber& operator--();
|
||||
|
||||
/**
|
||||
* Post-increment operator
|
||||
* @return The incremented BigNumber
|
||||
*/
|
||||
BigNumber operator++(int);
|
||||
|
||||
/**
|
||||
* Post-decrement operator
|
||||
* @return The decremented BigNumber
|
||||
*/
|
||||
BigNumber operator--(int);
|
||||
|
||||
/**
|
||||
* The index operator
|
||||
* @param index The position being looked at
|
||||
* @return The number at the specified position in the BigNumber string
|
||||
*/
|
||||
unsigned int operator[](int index);
|
||||
|
||||
private:
|
||||
std::string _numberString; //The big number represented as a string
|
||||
|
||||
//Methods
|
||||
BigNumber addll(const long long &other);
|
||||
BigNumber addstr(const std::string &other);
|
||||
BigNumber subtractll(const long long &other);
|
||||
BigNumber subtractstr(const std::string &other);
|
||||
BigNumber multiplyll(const long long &other);
|
||||
BigNumber multiplystr(const std::string &other);
|
||||
BigNumber dividell(const long long &other);
|
||||
BigNumber dividestr(const std::string &other);
|
||||
};
|
||||
|
||||
|
||||
|
||||
#endif
|
||||
Vendored
+12
@@ -0,0 +1,12 @@
|
||||
CrashRpt Project Authors:
|
||||
|
||||
Mike Carruth - CrashRpt project originator
|
||||
Oleg Krivtsov (zexspectrum) - current CrashRpt project maintainer
|
||||
|
||||
Also thanks to:
|
||||
|
||||
David Kelvin (crcode.s) for his money donation
|
||||
Thomas Fischer (tdev) for his Python statistics collection script
|
||||
Andy Schoenle for his German language file
|
||||
Davide Zaccanti for his Italian language file
|
||||
hadop for his French translation
|
||||
Vendored
+634
@@ -0,0 +1,634 @@
|
||||
======= Change History ========
|
||||
|
||||
--- Ver. 1.4.3 ---
|
||||
|
||||
- New: Crash log files are now saved under Logs subdirectory of error report directory.
|
||||
A crash log file is named like CrashRpt-Log-<date>-<time>-{<crashguid>}.txt.
|
||||
Recent log files are stored even if corresponding crash reports were delivered
|
||||
(to give user an ability to review recent crash information). When more than 10 logs
|
||||
are accumulated, the oldest ones are removed.
|
||||
|
||||
- New: Added CR_INSTALL_INFO::nRestartTimeout structure field. Using this parameter,
|
||||
you can override the default app restart timeout (60 seconds).
|
||||
|
||||
- New: added Slovak language file (contributed by Zoltan Tirinda)
|
||||
- New: added Japaneze language file (contributed by devil.tamachan)
|
||||
- New: added Czech language file (contributed by Petr Pytelka)
|
||||
- New: Added Polish lang file (issue 241)
|
||||
|
||||
- Fixed: Crashsender SMTP sendMsg - Errorhandling (issue 200)
|
||||
- Fixed: pfnCrashCallback2 is missing in tagCR_INSTALL_INFOW (issue 211)
|
||||
- Fixed: Version 1402 does not include files attached with "crAddFile2" in case of
|
||||
a long path name (issue 209)
|
||||
- Fixed: Few issues with static code analysis (issue 220)
|
||||
- Fixed: Wrong screen video capture video with multi screen (issue 215)
|
||||
- Fixed: crAddScreenshot2() nJpegQuality is only used for the first error report
|
||||
then it is always set to 0 (issue 217)
|
||||
- Fixed: Added file changes (renamed, moved, removed, etc.) within a
|
||||
client program's running session (issue 219)
|
||||
- Fixed: Adding custom properties with same name results in CrashSender.exe assertion
|
||||
failure (issue 216).
|
||||
- Fixed: 'Attach More Files' : Adding large amount of files (over >= 10)
|
||||
unsuccessfully (issue 218)
|
||||
- Fixed: Also add your x64 version of dbghelp.dll to the distributed file (issue 199)
|
||||
|
||||
--- Ver. 1.4.2 ---
|
||||
|
||||
- New: Added an ability to add multiple files to crash reports with crAddFile2()
|
||||
using file search pattern (e.g. "*.log"). This implements feature request
|
||||
described in issue 190.
|
||||
|
||||
- New: Added new flag CR_INST_AUTO_THREAD_HANDLERS allowing to
|
||||
install/uninstall exception handlers automatically in DllMain()
|
||||
on DLL_THREAD_ATTACH/DETACH (issue 185).
|
||||
|
||||
- New: adjusting dump privileges to avoid error 'Only part of a ReadProcessMemory
|
||||
or WriteProcessMemory request was completed.'
|
||||
|
||||
- Fixed: Screenshot file still sent even if deleted (issue 186).
|
||||
- Fixed: Video division by zero (issue 189)
|
||||
- Fixed: Video missing from report (issue 187)
|
||||
- Fixed: No crash data is sent to URL when we have a redirect (Issue 191)
|
||||
- Fixed: CCrashHandler.m_hWndVideoParent not initialized to a
|
||||
default value (issue 195)
|
||||
|
||||
|
||||
--- Ver. 1.4.1 ---
|
||||
|
||||
- New: Added an ability to preview OGG video files in Error Report Details dialog.
|
||||
To preview a file, select it in the list of files.
|
||||
|
||||
- New: Added an bility for end user to delete screenshots, registry keys and video file
|
||||
from crash report through context menu of Error Report Details dialog
|
||||
(added CR_AS_ALLOW_DELETE flag for crAddScreenshot2() function,
|
||||
CR_AR_ALLOW_DELETE flag for crAddRegKey() function and CR_AV_ALLOW_DELETE
|
||||
flag for crAddVideo() function). (issue 183)
|
||||
|
||||
- New: Added back the crExceptionFilter() function removed previously as deprecated.
|
||||
It seems that some users require that function. (issue 175).
|
||||
|
||||
- New: Extended unit tests (added ExceptionHandlerTests) (issue 114)
|
||||
|
||||
- Fixed: Exception handling problems (issue 180)
|
||||
- Fixed: Update italian language file (issue 174)
|
||||
- Fixed again: HTTPS certificate problem (issue 151)
|
||||
- Fixed: Custom property cleared by adding other property (issue 176)
|
||||
- Fixed: Running crprober on windows 7 results in no stack trace output (issue 182)
|
||||
|
||||
|
||||
--- Ver. 1.4.0 ---
|
||||
|
||||
- New: CrashRpt is now able to capture end user's desktop and record what happened
|
||||
just before crash to an .ogg video file and include the file to crash report.
|
||||
The recorded information may help the software vendor to better understand
|
||||
what actions the end user performed before client application crashed and
|
||||
reproduce the error (issue 122).
|
||||
|
||||
- New: Added new crAddVideo() function to record the desktop state to a video file
|
||||
and add the file to crash report.
|
||||
|
||||
- New: Added code of Theora video codec and OGG container (libtheora and libogg).
|
||||
|
||||
- New: New-style crash callback replacing the obsolete LPGETLOGFILE() callback.
|
||||
Added PFNCRASHCALLBACK() callback function prototype, CR_CRASH_CALLBACK_INFO
|
||||
structure and crSetCrashCallback() function.
|
||||
|
||||
- New: Added an ability to continue program execution after crash. This can be performed
|
||||
through crash callback (see CR_CRASH_CALLBACK_INFO::bContinueExecution structure
|
||||
member). This partially implements feature request in issue 125.
|
||||
|
||||
- New: Removed deprecated constant CR_INST_ALL_EXCEPTION_HANDLERS, use CR_INST_ALL_POSSIBLE_HANDLERS
|
||||
constant instead.
|
||||
|
||||
- New: Removed legacy method of error report delivery as Base-64-encoded data.
|
||||
Now binary-encoded HTTP uploads are always used instead. This makes the
|
||||
constant CR_INST_HTTP_BINARY_ENCODING useless.
|
||||
|
||||
- Fixed: Memory Leak (or rather memory not deallocated before program exit) (issue 169)
|
||||
- Fixed: Can not restart application. Use CR_INST_APP_RESTART flag (issue 165)
|
||||
|
||||
|
||||
--- Ver. 1.3.1 ---
|
||||
|
||||
- New: Removed support of obsolete Visual Studio .NET 2003.
|
||||
|
||||
- New: Removed deprecated functions crAddFileA(), crAddFileW(),
|
||||
crInstallToCurrentThread(), crExceptionFilter() and deprecated
|
||||
constant CR_WIN32_STRUCTURED_EXCEPTION.
|
||||
|
||||
- New: Improved robustness to stack overflow (issue 121). Now stack overflow is handled
|
||||
in separate thread makeing CrashRpt more robust to problem of not enogh stack memory.
|
||||
|
||||
- New: Added constant CR_STACK_OVERFLOW that can be passed to crEmulateCrash() function
|
||||
to cause stack overflow.
|
||||
|
||||
- New: Added an ability to attach more files to error report or delete selected files
|
||||
from error report through context menu of Error Report Details dialog (issue 132).
|
||||
Introduced new flag CR_INST_ALLOW_ATTACH_MORE_FILES for crInstall() function.
|
||||
|
||||
- New: Added new CR_AF_ALLOW_DELETE flag for crAddFile2() function. If this flag is specified,
|
||||
the user will be able to delete the file from error report using context menu of
|
||||
Error Report Details dialog. (issue 132)
|
||||
|
||||
- New: Added support of SMTP authentication (AUTH LOGIN) (Issue 143).
|
||||
|
||||
- New: Added an ability to store the user's E-mail address and re-use later. When user
|
||||
enters his E-mail into "Your E-mail" field of Error Report dialog, the address
|
||||
is saved and stored in ~CrashRpt.ini file. When a crash occurs
|
||||
later, the address is filled in automatically. (issue 155)
|
||||
|
||||
- New: Added CR_INST_SEND_MANDATORY flag. This flag removes the "Close" and "Other actions"
|
||||
buttons from Error Report dialog, thus making the sending procedure mandatory for user
|
||||
(issue 126).
|
||||
|
||||
- New: Added CR_INST_SHOW_ADDITIONAL_INFO_FIELDS flag. This flag makes "Your E-mail" and
|
||||
"Describe what you were doing when the problem occurred" fields of Error Report
|
||||
dialog always visible. By default (when this parameter not specified),
|
||||
those fields are hidden and user needs to click the "Provide additional info
|
||||
(recommended)" link to show them (issue 129).
|
||||
|
||||
- New: Introduced command line parameter /terminate for CrashSender.exe.
|
||||
This resolves a problem with installers that will want to update the exe file;
|
||||
there was no way to tell the sender exe program to exit now (issue 142).
|
||||
Launching "CrashSender.exe /terminate" would look for all open CrashSender.exe processes
|
||||
and terminate them immediately (without sending reports or waiting for completion).
|
||||
Terminating the process is acomplished with TerminateProcess(hProcess) function.
|
||||
|
||||
- New: Reorganized demos (moved to demos folder and renamed CrashRptTest=>WTLDemo, crashcon=>ConsoleDemo).
|
||||
|
||||
- New: Added new demo application - MFCDemo. This is to demonstrate usage of CrashRpt
|
||||
with MFC-based apps.
|
||||
|
||||
- New: Refactored code of CrashSender project making it more conforming to
|
||||
the Model-View-Controller methodology.
|
||||
|
||||
- Fixed: Impossible to send Crash reports in Windows 7 64bits (issue 104).
|
||||
- Fixed: Crash report is not discarded when 'Close the program' is selected (issue 94).
|
||||
- Fixed: Application is restarted twice after crash (issue 115).
|
||||
- Fixed: CRP_COL_PROBLEM_DESCRIPTION not working (issue 118).
|
||||
- Fixed: When copying a log file into the crash archive, access it with FILE_SHARE_WRITE (issue 124)
|
||||
- Fixed: Support multiple e-mail recipients (issue 123).
|
||||
- Fixed: Support multiple crash reports per application instance (issue 127)
|
||||
- Fixed: CrashSender.exe crashes when attempting to write long strings into NOTIFYICONDATA (issue 137)
|
||||
- Fixed: a small typo in the german language file (issue 159)
|
||||
- Fixed: A single .pch file is used by Release and Debug configs causing compiler errors (issue 147)
|
||||
- Fixed: SigIntHandler installed by CR_INST_SIGILL_HANDLER (issue 154)
|
||||
- Fixed: ASSERTION failure when CrThreadAutoInstallHelper fails to install handler (issue 148).
|
||||
- Fixed: Deprecated CMC functions cause Visual studio 2012 rc compile error (issue 156)
|
||||
- Fixed: Need to add "SMTP:" to the 'emailTo' address for (S)MAPI (issue 140).
|
||||
- Fixed: HTTPS certificate problem (issue 151)
|
||||
- Fixed: Resource leak in CrashRpt (issue 160)
|
||||
- Fixed: HttpEndRequest() fails. GetLastError() = ERROR_INTERNET_TIMEOUT (12002) (issue 138)
|
||||
- Fixed: Memory allocation in CCrashHandler::GetExceptionPointers can fail (issue 157)
|
||||
- Fixed: Timestamp of saved files (issue 135)
|
||||
- Fixed: CErrorReportSender::DumpRegKey is omitting some subkeys and some values (issue 162)
|
||||
- Fixed: CErrorReportSender::DumpRegKey issue with REG_BINARY (issue 130).
|
||||
- Fixed: Order of custom properties (issue 131).
|
||||
|
||||
|
||||
--- Ver. 1.3.0 ---
|
||||
|
||||
- Added support of CMake - cross-plaform make system. Although CrashRpt doesn't support operating systems
|
||||
other than Windows, CMake makes it easier to maintain build configurations for different versions of Visual Studio.
|
||||
Project files for VC++ .NET 2003, 2005, 2008, 2010 and VC++ Express can be generated.
|
||||
|
||||
- Added instructions to the documentation on how to generate Visual Studio project files with CMake.
|
||||
|
||||
- Removed project files for Visual Studio 2003 (CrashRpt_v2003.sln) and Visual Studio 2005 (CrashRpt_v2005.sln).
|
||||
To compile in VS2010, use Visual Studio 2010 project files (or use CMake to generate Visual Studio project
|
||||
files for your favorite version of Visual Studio).
|
||||
|
||||
- Binary files now have version suffices (CrashRpt1300.dll, CrashRptProbe1300.dll and CrashSender1300.exe). This is
|
||||
to resolve problems of loading incorrect version of the DLL.
|
||||
|
||||
- Removed obsolete API InstallW, InstallA, Uninstall, AddFileW, AddFileA, GenerateErrorReport.
|
||||
|
||||
- Added an ability to select/deselect/delete all error reports and delete selected reports in ResendDlg (issue 112).
|
||||
|
||||
- Updated Italian lang file (issue 92).
|
||||
- Updated German lang file (issue 98).
|
||||
- Updated French lang file (issue 107).
|
||||
|
||||
- Fixed: CrashSender fails to initialize if two files both have empty destination properties (issue 88)
|
||||
- Fixed: DestroyView fails in SharedMem implementation (issue 93)
|
||||
- Fixed: CHttpRequestSender::InternalSend() sends bad request header (issue 95)
|
||||
- Fixed: Potential buffer overflow in CHttpRequestSender::InternalSend() (issue 96)
|
||||
- Fixed: Formatting / coding request (issue 97)
|
||||
- Fixed: Typo in string conversion class (issue 99)
|
||||
- Fixed: Compilation fails if build directory contains spaces (issue 100)
|
||||
- Fixed:The space confuses some mail servers, the RFC for QUIT defines that there should be no space. (issue 105)
|
||||
- Fixed: RFC correct base64 for SMTP send (issue 106)
|
||||
- Fixed: Wrong handling of dwFlags when setting handlers (issue 109)
|
||||
- Fixed: SMTP fails if Date header missing (issue 110)
|
||||
|
||||
--- Ver. 1.2.10 ---
|
||||
|
||||
- Added new language files: German, Spanish, French, Hindi, Italian, Korean, Portuguese and Chinese Simplified.
|
||||
Some of these files were produced by professional translators (Korean, Chinese Simplified), but others
|
||||
are generated with help of an automated translation tool, so do not hesitate to report mistakes.
|
||||
|
||||
- Refactored unit tests, so now they support fixtures and execute faster then before.
|
||||
|
||||
- Added new test suites LangFileTests and CrproberTests.
|
||||
|
||||
- Fixed: Typo in HttpRequestSender.cpp (issue 79)
|
||||
|
||||
- Fixed: Typos in test project (issue 82)
|
||||
|
||||
- Fixed: Replace relative paths with OutDir and IntDir (issue 80)
|
||||
|
||||
- Fixed: MD5 files are not removed (issue 83)
|
||||
|
||||
- Fixed: CrashSender cannot properly send old reports (with smtp) (issue 84)
|
||||
|
||||
- Fixed: CrashSender manifest file prevents CrashSender from launching in x64 (issue 87)
|
||||
|
||||
--- Ver. 1.2.9 ---
|
||||
|
||||
- Compiler/linker output for x64 platform is now directed to bin\x64, while output dir for Win32 platform
|
||||
is the same (bin) (issue 77).
|
||||
|
||||
- Improved documentation (extended "Using CrashRpt API" and "An Example of Using API", "Writing Robust Code" sections)
|
||||
|
||||
- Annotated code with SAL macros and fixed some PREfast warnings (this should fix some potential stability and
|
||||
security issues).
|
||||
|
||||
- Fixed: Clarification for CR_INST_DONT_SEND_REPORT & CR_AF_TAKE_ORIGINAL_FILE
|
||||
|
||||
- Fixed: SVN/package file encoding strangeness (issue 76)
|
||||
|
||||
- Fixed: If I pass the short name for the path to crash report, it failed to create the directory (issue 78)
|
||||
|
||||
|
||||
--- Ver. 1.2.8 ---
|
||||
|
||||
- Added JPEG library code from Independent Jpeg Group.
|
||||
|
||||
- Improved desktop screenshot capture: added an ability to save screenshots as JPEG files, an
|
||||
ability to define JPEG image quaility, an ability to save grayscale screenshots.
|
||||
|
||||
- New function crAddScreenshot2() allows to define JPEG quality.
|
||||
|
||||
- Implemented Jpeg image preview in Error Report Details dialog.
|
||||
|
||||
- New section ScreenshotInfo in crash description XML file
|
||||
|
||||
- Modified compiler options in all projects to favor small size (Release configuration). This should
|
||||
reduce the size of the binaries.
|
||||
|
||||
- Completely rewritten the code responsible for communication between CrashRpt.dll and CrashSender.exe
|
||||
(now using shared memory instead of temporary XML files)
|
||||
|
||||
- Added an ability to add a custom title icon for CrashRpt dialogs through CR_INSTALL_INFO::pszCustomSenderIcon.
|
||||
|
||||
- New sections of documentation: Running automated tests and Making Your Code Robust.
|
||||
|
||||
- Refactored Tests project (removed unneeded functionality). Additional test cases.
|
||||
New test suite DeliveryTests. Tests now work even for Release LIB build configuration.
|
||||
|
||||
- Improved Doxyfile, removed search index and now the documentation should take less disk space.
|
||||
|
||||
- Added new table CRP_TBL_MDMP_LOAD_LOG
|
||||
|
||||
- New column CRP_COL_MODULE_LOADED_IMAGE_NAME
|
||||
|
||||
- MD5 file is now generated and stored in error report folder when using CR_INST_STORE_ZIP_ARCHIVES flag
|
||||
|
||||
- New member hSenderProcess in CR_EXCEPTION_INFO struct
|
||||
|
||||
- Fixed a mistake in basic_stats.py (now using multimap instead of map)
|
||||
|
||||
- Reorganized tinyxml files (now they are compiled in a separate project)
|
||||
|
||||
- Extended lang files (new strings DescCrashDump, DescXML, DescScreenshot, DescRegKey)
|
||||
|
||||
- Added HTTPS support for error report upload
|
||||
|
||||
- The function crExceptionFilter() is declared deprecated.
|
||||
|
||||
- fix: CR_INST_STORE_ZIP_ARCHIVES (issue 59)
|
||||
- fix: crAddScreenshot( CR_AS_MAIN_WINDOW); (issue 61)
|
||||
- fix: Cannot be loaded under Win2000 due to import of the GetGeoInfo function from kernel32.dll (issue 65)
|
||||
- fix: std::string CCrashHandler::XmlEncodeStr(CString sText) error (issue 67)
|
||||
- fix: CR_INST_STORE_ZIP_ARCHIVES and CR_AF_TAKE_ORIGINAL_FILE (issue 69)
|
||||
- fix: atlassert in crashhandler.cpp (issue 70)
|
||||
- fix: Registry keys with ampersand (&) are not dumped (issue 71)
|
||||
|
||||
|
||||
--- Ver. 1.2.7 ---
|
||||
|
||||
- Added Tests project that implements automated tests for CrashRpt and
|
||||
CrashRptProbe functionality.
|
||||
|
||||
- Reorganized directory structure to better reflect architecture.
|
||||
|
||||
- Updated tinyxml, minizip and zlib files to the latest available versions.
|
||||
|
||||
- Refactored scripts/postprocess.bat. It now better groups similar error reports.
|
||||
|
||||
- New tag GeoLocation - user's geographic location like 'en-us' is now recorded inside of
|
||||
crash description XML.
|
||||
|
||||
- New tag OSIs64Bit - detects if user's OS is 64-bit and records this inside of
|
||||
crash description XML.
|
||||
|
||||
- Improved the way crprober.exe cleans up its temporary files.
|
||||
|
||||
- New columns CRP_COL_OS_IS_64BIT and CRP_COL_GEO_LOCATION for CRP_TBL_XMLDESC_MISC table.
|
||||
|
||||
- New column CRP_COL_EXCEPTION_THREAD_STACK_MD5 for CRP_TBL_MDMP_MISC table.
|
||||
|
||||
- Fixed issue with Chineese symbols in app name (issue 54).
|
||||
|
||||
- Improved CFilePreviewCtrl to support UTF-8 and UTF-16 encoding (issue 56). Also improved
|
||||
WM_MOUSEWHEEL message handling (scrolling preview by mouse wheel).
|
||||
|
||||
- Using critical section to avoid access to CCrashHandler from several crashed threads (issue 52).
|
||||
|
||||
- Fixed: Leaving pszRestartCmdLine NULL, gives new application instance blank first argument (issue 50).
|
||||
|
||||
- Fixed incorrect argument order in crAddRegKeyA (issue 49).
|
||||
|
||||
- Added new flag CR_INST_STORE_ZIP_ARCHIVES that allows to store ZIP archives along with uncompressed
|
||||
error report files (issue 53).
|
||||
|
||||
- Fixed: Version info caused crash (issue 48).
|
||||
|
||||
- Improved documentation (section Architecture Overview).
|
||||
|
||||
- Improved documentation (section Using Crash Minidump) (issue 45).
|
||||
|
||||
- Fixed DNS access problem for SMTP proxy (issue 51).
|
||||
|
||||
--- Ver. 1.2.6 ---
|
||||
|
||||
- Added project files for Visual Studio 2010 (issue 35).
|
||||
|
||||
- Using .def files to undecorate API function names.
|
||||
|
||||
- Extended crEmulateCrash(), new constant CR_THROW -- tests how a thrown C++
|
||||
exception is intercepted (issue 35).
|
||||
|
||||
- Fixed: exit(1) in different thread may cause crashes (issue 43). Now using
|
||||
TerminateProcess() instead of exit() or ExitProcess().
|
||||
|
||||
- Fixed: Error report is sent twice if crashes in a DLL (issue 44). Using crash
|
||||
counter variable to avoid multiple crash report generation.
|
||||
|
||||
--- Ver. 1.2.5 ---
|
||||
|
||||
- Introduced an ability to send error reports queued for delivery (issue 33).
|
||||
New flag CR_INST_SEND_QUEUED_REPORTS.
|
||||
|
||||
- Fixed: zipped file timestamps are incorrect (issue 40).
|
||||
|
||||
- Fixed: Release buffer from DnsQuery (issue 42).
|
||||
|
||||
- Fixed: exit(1) in different thread may cause crashes (issue 43).
|
||||
|
||||
- Fixed: A bug in CScreenCapture multiple monitors
|
||||
|
||||
- Fixed: Issue with g_CrashInfo.m_uPriorities. Introduced CR_NEGATIVE_PRIORITY constant.
|
||||
|
||||
- Refactored php example of how to receive error reports by HTTP.
|
||||
|
||||
- Extended documentation.
|
||||
|
||||
--- Ver. 1.2.4 ---
|
||||
|
||||
- Introduced an ability to restart an application automatically on crash. The application is
|
||||
restarted only if at least 60 seconds have elapsed since its start. This is done to avoid cyclic
|
||||
restarts of an unstable application which crashes on start up. This is the enhancement requested
|
||||
in issue 11.
|
||||
|
||||
- Introduced an ability to preview graphics files (BMP, PNG) in Details dialog. This is useful if a user
|
||||
would like to preview the desktop screenshot image attached to the error report.
|
||||
|
||||
- An ability to not include minidump file into error report. This implements the enhancement requested in
|
||||
issue 33.
|
||||
|
||||
- An ability to specify custom email text by using CR_INSTALL_INFO::pszEmailText member.
|
||||
|
||||
- An ability to specify custom directory and file name for the language file. This will be useful for applications
|
||||
that need to modify UI language on the fly. This is requested in issue 34.
|
||||
|
||||
- An ability to disable particular error report sending transport by specifying a negative priority in
|
||||
CR_INSTALL_INFO::uPriorities array.
|
||||
|
||||
- An ability to specify SMTP proxy for built-in SMTP client. This may be useful for server-side software that
|
||||
would need to configure SMTP transport without querying DNS MX (mail exchange) record.
|
||||
|
||||
--- Ver. 1.2.3 ---
|
||||
|
||||
- Improved file preview in DetailDlg. Now a file can be previewed in HEX or in text mode.
|
||||
|
||||
- Ability to customize the port for SMTP connection.
|
||||
|
||||
- Fixed: CrashSender Crash (issue 24)
|
||||
|
||||
- Fixed: dbghelp.dll cannot be found (issue 26)
|
||||
|
||||
- Fixed: Certain fields cannot be omitted (issue 27).
|
||||
|
||||
- Fixed: Release LIB configuration is obsolete (issue 28).
|
||||
There may be some people using Release LIB configuration, so the configuration was made up-to-date.
|
||||
|
||||
|
||||
--- Ver. 1.2.2 ---
|
||||
|
||||
- WTL files are now included into CrashRpt distribution.
|
||||
|
||||
- Completely removed dependency on zip_utils (it is better to use minizip).
|
||||
|
||||
- Removed vs.2008 project files. If you need to compile in VS 2008 and higher, use VS project convertor.
|
||||
|
||||
- Modifyed communication between CrashRpt.dll and CrashSender.exe. Now XML file is used for this purpose instead of named pipe.
|
||||
|
||||
- Refactored code. After crash, all complex actions are done outside of the crashed process (inside of CrashSender.exe).
|
||||
This includes taking desktop screenshot, minidump generation, file copying, file compression and sending.
|
||||
|
||||
- Introduced silent mode (CrashRpt sends report silently without showing GUI).
|
||||
This is useful for services and server processes.
|
||||
|
||||
- Improved documentation (restyling).
|
||||
|
||||
- Introduced multi-part HTTP uploads. This will help to send large error reports more effectively.
|
||||
|
||||
- Fixed: Doesn't work in Windows 2000 (issue 17)
|
||||
- Fixed: CrashSender doesn't work on Windows 2000 (issue 21)
|
||||
|
||||
- Fixed: mistyping? (issue 18)
|
||||
- Fixed: inconsistency in xml Crash Log (issue 20)
|
||||
- Fixed some problems with UTF-8 encoded strings written by tinixml.
|
||||
|
||||
- Fixed: crprober.exe does not work well (issue 19)
|
||||
|
||||
- New: Introcuded an ability to specify the folder where crash reports are created (issue 22)
|
||||
|
||||
- New: Introduced an ability to export error report through "Export..." button on Error Report Details dialog.
|
||||
|
||||
--- Ver. 1.2.1 ---
|
||||
|
||||
- Refactored crash report generation and sending functionality. Now report files are stored
|
||||
in unzipped state, compression is performed during sending procedure. This will be required for
|
||||
huge reports (that will be fully supported in the future).
|
||||
|
||||
- Added support of x64 platform (issue 7).
|
||||
|
||||
- Added an ability to make screenshots of the screen or the main app window on crash
|
||||
through crAddScreenshot() function (issue 8).
|
||||
|
||||
- More information is collected on crash (memory usage, open handles count and GUI resources)
|
||||
|
||||
- Ability to add custom text properties to the crash descriptor through crAddProperty() function (issue 9).
|
||||
|
||||
- New function crAddFile2() improving the application-defined files addition.
|
||||
|
||||
- Ability to control which dbghelp.dll to use (issue 10).
|
||||
|
||||
- Ability to define the type of minidump (from normal size to huge size) (issue 10).
|
||||
Contributed by crcode.s.
|
||||
|
||||
- Fixed incorrectly displayed file size in DetailsDlg (issue 14).
|
||||
|
||||
- Fixed untranslatable Close button of DetailsDlg (issue 15).
|
||||
|
||||
- Fixed: Access to CCrashHandler::m_ThreadExceptionHandlers should be synchronized (issue 16).
|
||||
|
||||
--- Ver. 1.2.0 ---
|
||||
|
||||
- Reorgranized the include files; moved from 'CrashRpt\include' to 'include'.
|
||||
|
||||
- Support of error report batch processing (crprober.exe tool).
|
||||
|
||||
- New application programming interface for error report processing (CrashRptProbe.dll).
|
||||
|
||||
- Introduced functions crpOpenErrorReport(), crpCloseErrorReport(),
|
||||
crpGetProperty(), crpGetLastErrorMsg().
|
||||
|
||||
- Fixed problem with missing gzio.c (issue 6).
|
||||
|
||||
- Extended documentation : new section 'Automating Error Report Processing'.
|
||||
|
||||
--- Ver. 1.1.3 ---
|
||||
|
||||
- Support of globalization and RTL languages.
|
||||
|
||||
- Reorganized and improved documentation; New pages Architecture Overview and
|
||||
Internationalization Support.
|
||||
|
||||
- Added <?xml version="1.0" encoding="utf-8" ?> element in the
|
||||
beginning of crash descriptor XML.
|
||||
|
||||
--- Ver. 1.1.2 ---
|
||||
|
||||
- crInstall: Ability to select what exception handlers to install
|
||||
|
||||
- Extended CR_INSTALL_INFO with new members: pszPrivacyPolicyURL and dwFlags.
|
||||
|
||||
- New API function crInstallToCurrentThead2().
|
||||
|
||||
- Improved documentation; Fixed some mistakes; Added info on compiling CrashRpt in VC++ Express
|
||||
|
||||
- Using standard Windows convention __stdcall instead of __cdecl in API function declarations
|
||||
|
||||
- Using undecorated API function names (extern "C")
|
||||
|
||||
- Using static zlib linkage instead of zlib DLL
|
||||
|
||||
- Replaced obsolete ATL 3.0 string conversion macros with self-written class strconv_t.
|
||||
|
||||
- Fixed some compilation warnings in VC++ Express
|
||||
|
||||
- Fixed wrong "unh" message box in unhandled exception handler
|
||||
|
||||
- Fixed bug in CUtility::GetOSFriendlyName() -- Operating system build
|
||||
number and service pack are never retrieved
|
||||
|
||||
- Fixed error with writing 'ExceptionCode' to XML (always zero)
|
||||
|
||||
- Writing exception code to XML in hex format
|
||||
|
||||
- Refactored code of crEmulateCrash()
|
||||
|
||||
|
||||
--- Ver. 1.1.1 ---
|
||||
|
||||
- Support of Visual Studio Express edition (EVS 2005 and EVS 2008)
|
||||
|
||||
- Improved documentation; New page About Exceptions and Exception Handling
|
||||
|
||||
- New wrapper classes CrAutoInstallHelper and CrThreadAutoInstallHelper
|
||||
|
||||
- MD5 hash for error report is calculated and attached to email
|
||||
when error report is sent over email
|
||||
|
||||
- Error report is removed when sent successfuly
|
||||
|
||||
- Refactored error report sending code
|
||||
|
||||
- Extended E-mail message text generation for error reports being sent over email
|
||||
|
||||
- 'Copy selected lines' and 'copy the whole log' from context menu of error report
|
||||
sending log
|
||||
|
||||
- Fixed many VS-version-specific bugs
|
||||
|
||||
--- Ver. 1.1 ---
|
||||
|
||||
|
||||
Major Features:
|
||||
|
||||
- Removed support of Visual Studio 6.0 and added support of VS.NET 2003,
|
||||
VS 2005 and VS 2008
|
||||
|
||||
- New API functions (crInstall(); crUninstall(); crInstallToCurrentThread();
|
||||
crUninstallFromCurrentThread(); crGenerateErrorReport(); crExceptionFilter();
|
||||
crEmulateCrash(); crGetLastErrorMsg())
|
||||
|
||||
- Character set specific functions have A and w suffixes. Introduced macros for
|
||||
defining character set indepandent function names mapping
|
||||
|
||||
- Support of various C++ exception handlers (Visual Studio-specific)
|
||||
|
||||
- Crash report generation and crash sending functionality are separeted into
|
||||
different modules (CrashRpt.dll and CrashSender.exe)
|
||||
|
||||
- New ways of sending error reports: using HTTP connection, using SMTP embed client or
|
||||
(as in 1.0) using Simple MAPI.
|
||||
|
||||
- Each error report is now assigned a unique CrashGUID
|
||||
|
||||
- Doxygen-based documentation system
|
||||
|
||||
- Revamped GUI of Send Error Report dialog
|
||||
|
||||
- New Error Report Sending Progress dialog
|
||||
|
||||
- Improved crash descriptor XML format
|
||||
|
||||
|
||||
Minor features:
|
||||
|
||||
- Using TinyXml framework instead of MSXML
|
||||
|
||||
- Using the latest version (at the moment) of dbghelp
|
||||
|
||||
- Using the latest version (at the moment) of zlib
|
||||
|
||||
|
||||
--- Ver. 1.0 ---
|
||||
|
||||
|
||||
* 03/17/2003
|
||||
o Replaced MFC with WTL.
|
||||
o Changed crashrpt interface.
|
||||
o Major refactoring.
|
||||
o Updated article.
|
||||
o Details dialog preview window now uses system defined window color instead of white.
|
||||
o Directory structure not saved in ZIP.
|
||||
o Support for use by multiple apps.
|
||||
o Buffer overrun error when previewing files > 32k.
|
||||
o Main dialog now displays app icon.
|
||||
* 01/12/2003
|
||||
o Initial release.
|
||||
Vendored
+26
@@ -0,0 +1,26 @@
|
||||
Copyright (c) 2003, The CrashRpt Project Authors.
|
||||
All rights reserved.
|
||||
|
||||
Redistribution and use in source and binary forms, with or without modification,
|
||||
are permitted provided that the following conditions are met:
|
||||
|
||||
* Redistributions of source code must retain the above copyright notice, this
|
||||
list of conditions and the following disclaimer.
|
||||
|
||||
* Redistributions in binary form must reproduce the above copyright notice,
|
||||
this list of conditions and the following disclaimer in the documentation
|
||||
and/or other materials provided with the distribution.
|
||||
|
||||
* Neither the name of the author nor the names of its contributors
|
||||
may be used to endorse or promote products derived from this software without
|
||||
specific prior written permission.
|
||||
|
||||
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY
|
||||
EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
|
||||
OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT
|
||||
SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
|
||||
INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED
|
||||
TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
|
||||
BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
|
||||
STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
|
||||
OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
Vendored
BIN
Binary file not shown.
Vendored
+1805
File diff suppressed because it is too large
Load Diff
BIN
Binary file not shown.
BIN
Binary file not shown.
BIN
Binary file not shown.
BIN
Binary file not shown.
BIN
Binary file not shown.
BIN
Binary file not shown.
BIN
Binary file not shown.
BIN
Binary file not shown.
BIN
Binary file not shown.
BIN
Binary file not shown.
BIN
Binary file not shown.
BIN
Binary file not shown.
BIN
Binary file not shown.
Binary file not shown.
Vendored
+145
@@ -0,0 +1,145 @@
|
||||
=========================================================
|
||||
Language Files Change Log
|
||||
|
||||
This info may be helpful when updating language files from
|
||||
a previous version to the latest version.
|
||||
|
||||
=========================================================
|
||||
|
||||
--- v.1.4.3 ---
|
||||
|
||||
No changes
|
||||
|
||||
--- v.1.4.2 ---
|
||||
|
||||
No changes
|
||||
|
||||
--- v.1.4.1 ---
|
||||
|
||||
* In [DetailDlg]
|
||||
- PreviewVideo - new
|
||||
|
||||
--- v.1.4.0 ---
|
||||
|
||||
* In [DetailDlg]
|
||||
- DescVideo - new
|
||||
* New section [VideoRecDlg]
|
||||
|
||||
|
||||
--- v.1.3.1 ---
|
||||
|
||||
* In [DetailDlg]
|
||||
- Open - new
|
||||
- DeleteSelected - new
|
||||
- AttachMoreFiles - new
|
||||
|
||||
--- v.1.3.0 ---
|
||||
|
||||
* In [DetailDlg]
|
||||
- SelectAll - new
|
||||
- DeselectAll - new
|
||||
- DeleteSelected - new
|
||||
- DeleteAll - new
|
||||
|
||||
--- v.1.2.10 ---
|
||||
|
||||
No changes
|
||||
|
||||
--- v.1.2.9 ---
|
||||
|
||||
No changes
|
||||
|
||||
--- v.1.2.8 ---
|
||||
|
||||
* In [DetailDlg]
|
||||
- DescCrashDump - new
|
||||
- DescXML- new
|
||||
- DescScreenshot - new
|
||||
- DescRegKey - new
|
||||
|
||||
--- v.1.2.7 ---
|
||||
|
||||
* In [DetailDlg]
|
||||
- TextEncoding - new
|
||||
|
||||
--- v.1.2.6 ---
|
||||
|
||||
* In [DetailDlg]
|
||||
- Type - removed
|
||||
|
||||
--- v.1.2.5 ---
|
||||
|
||||
* In [MainDlg] section:
|
||||
- SubHeaderText - modified
|
||||
- OtherActions - new
|
||||
- SendReportLater - new
|
||||
|
||||
* New section [ResendDlg]:
|
||||
- ColumnCreationDate
|
||||
- ColumnSize
|
||||
- ColumnStatus
|
||||
- ClickForDetails
|
||||
- SelectedSize
|
||||
- SendNow
|
||||
- ShowLog
|
||||
- MyConsent
|
||||
- MyConsent2
|
||||
- PopupShow
|
||||
- PopupActions
|
||||
- PopupRemindLater
|
||||
- PopupNeverRemind
|
||||
- StatusPending
|
||||
- StatusInProgress
|
||||
- StatusSuccess
|
||||
- StatusFailed
|
||||
- CurrentAction
|
||||
- DeliveryingReports
|
||||
- DeliverySucceeded
|
||||
- DeliveryFailed
|
||||
|
||||
--- v.1.2.4 ---
|
||||
|
||||
The following strings have changed:
|
||||
|
||||
* In [MainDlg] section:
|
||||
- RestartApp - new
|
||||
|
||||
* In [DetailDlg] section:
|
||||
- PreviewImage - new
|
||||
|
||||
--- v.1.2.3 ---
|
||||
|
||||
The following strings have changed:
|
||||
|
||||
* In [DetailDlg] section:
|
||||
- NoDataToDisplay - new
|
||||
- PreviewAuto - new
|
||||
- PreviewText - new
|
||||
- PreviewHex - new
|
||||
|
||||
--- v.1.2.2 ---
|
||||
|
||||
The following strings have changed:
|
||||
|
||||
* In [DetailDlg] section:
|
||||
- Export - new
|
||||
|
||||
* In [ProgressDlg] section:
|
||||
- DlgCaptionExport - new
|
||||
- ExportedWithErrors - new
|
||||
|
||||
--- v.1.2.1 ---
|
||||
|
||||
The following strings have changed:
|
||||
|
||||
* In [MainDlg] section:
|
||||
- MyConsent - new
|
||||
- MyConsent2 - new
|
||||
|
||||
* In [ProgressDlg] section:
|
||||
- DlgCaption - modified
|
||||
- DlgCaption2 - new
|
||||
- CollectingCrashInfo - new
|
||||
- CompressingFiles - new
|
||||
|
||||
|
||||
Vendored
+1
@@ -0,0 +1 @@
|
||||
DisableFormat: true
|
||||
Vendored
+15
@@ -0,0 +1,15 @@
|
||||
root = true
|
||||
|
||||
[*.{cpp,h,inl,cmake,sh,bat,hlsl}]
|
||||
indent_style = tab
|
||||
indent_size = 4
|
||||
tab_width = 4
|
||||
trim_trailing_whitespace = true
|
||||
insert_final_newline = true
|
||||
|
||||
[CMakeLists.txt]
|
||||
indent_style = tab
|
||||
indent_size = 4
|
||||
tab_width = 4
|
||||
trim_trailing_whitespace = true
|
||||
insert_final_newline = true
|
||||
Vendored
+18
@@ -0,0 +1,18 @@
|
||||
# Convert LF to CRLF on windows on checkout and convert back before submitting to the repository
|
||||
* text=auto
|
||||
|
||||
# Explicitly declare text files to always be normalized and converted to native line endings on checkout
|
||||
*.cpp text
|
||||
*.inl text
|
||||
*.h text
|
||||
*.tof text
|
||||
*.bat text
|
||||
|
||||
# Force shell files to use LF only
|
||||
*.sh text eol=lf
|
||||
gradlew text eol=lf
|
||||
|
||||
# Declare binary file types
|
||||
*.tga binary
|
||||
*.bof binary
|
||||
*.bin binary
|
||||
+9
@@ -0,0 +1,9 @@
|
||||
# Please see the documentation for all configuration options:
|
||||
# https://docs.github.com/github/administering-a-repository/configuration-options-for-dependency-updates
|
||||
|
||||
version: 2
|
||||
updates:
|
||||
- package-ecosystem: "github-actions"
|
||||
directory: "/"
|
||||
schedule:
|
||||
interval: "weekly"
|
||||
+435
@@ -0,0 +1,435 @@
|
||||
name: Build
|
||||
|
||||
on:
|
||||
push:
|
||||
branches: [ master ]
|
||||
paths-ignore:
|
||||
- 'Docs/**'
|
||||
- '**.md'
|
||||
pull_request:
|
||||
branches: [ master ]
|
||||
paths-ignore:
|
||||
- 'Docs/**'
|
||||
- '**.md'
|
||||
|
||||
env:
|
||||
EMSCRIPTEN_VERSION: 3.1.64
|
||||
UBUNTU_CLANG_VERSION: clang++-18
|
||||
UBUNTU_GCC_VERSION: g++-14
|
||||
|
||||
jobs:
|
||||
linux-clang:
|
||||
runs-on: ubuntu-latest
|
||||
name: Linux Clang
|
||||
strategy:
|
||||
fail-fast: false
|
||||
matrix:
|
||||
build_type: [Debug, Release, Distribution]
|
||||
double_precision: [No, Yes]
|
||||
|
||||
steps:
|
||||
- name: Checkout Code
|
||||
uses: actions/checkout@v6
|
||||
- name: Install Vulkan
|
||||
run: ${{github.workspace}}/Build/ubuntu24_install_vulkan_sdk.sh
|
||||
- name: Configure CMake
|
||||
working-directory: ${{github.workspace}}/Build
|
||||
run: ./cmake_linux_clang_gcc.sh ${{matrix.build_type}} ${{env.UBUNTU_CLANG_VERSION}} -DDOUBLE_PRECISION=${{matrix.double_precision}}
|
||||
- name: Build
|
||||
run: cmake --build ${{github.workspace}}/Build/Linux_${{matrix.build_type}} -j $(nproc)
|
||||
- name: Test
|
||||
working-directory: ${{github.workspace}}/Build/Linux_${{matrix.build_type}}
|
||||
run: ctest --output-on-failure --verbose
|
||||
|
||||
linux_clang_tsan:
|
||||
runs-on: ubuntu-24.04
|
||||
name: Linux Clang Sanitizers
|
||||
strategy:
|
||||
fail-fast: false
|
||||
matrix:
|
||||
build_type: [ReleaseASAN, ReleaseUBSAN, ReleaseTSAN]
|
||||
|
||||
steps:
|
||||
- name: Checkout Code
|
||||
uses: actions/checkout@v6
|
||||
- name: Configure CMake
|
||||
working-directory: ${{github.workspace}}/Build
|
||||
run: ./cmake_linux_clang_gcc.sh ${{matrix.build_type}} ${{env.UBUNTU_CLANG_VERSION}} -DTARGET_VIEWER=OFF -DTARGET_SAMPLES=OFF -DTARGET_HELLO_WORLD=OFF -DTARGET_UNIT_TESTS=ON -DTARGET_PERFORMANCE_TEST=ON
|
||||
- name: Build
|
||||
run: cmake --build ${{github.workspace}}/Build/Linux_${{matrix.build_type}} -j $(nproc)
|
||||
- name: Unit Tests
|
||||
working-directory: ${{github.workspace}}/Build/Linux_${{matrix.build_type}}
|
||||
run: ctest --output-on-failure --verbose
|
||||
- name: Test ConvexVsMesh
|
||||
working-directory: ${{github.workspace}}/Build/Linux_${{matrix.build_type}}
|
||||
run: ./PerformanceTest -q=LinearCast -t=max -s=ConvexVsMesh
|
||||
- name: Test Ragdoll
|
||||
working-directory: ${{github.workspace}}/Build/Linux_${{matrix.build_type}}
|
||||
run: ./PerformanceTest -q=LinearCast -t=max -s=Ragdoll
|
||||
|
||||
linux-clang-so:
|
||||
runs-on: ubuntu-24.04
|
||||
name: Linux Clang Shared Library
|
||||
strategy:
|
||||
fail-fast: false
|
||||
matrix:
|
||||
build_type: [Debug, Release, Distribution]
|
||||
|
||||
steps:
|
||||
- name: Checkout Code
|
||||
uses: actions/checkout@v6
|
||||
- name: Configure CMake
|
||||
working-directory: ${{github.workspace}}/Build
|
||||
run: ./cmake_linux_clang_gcc.sh ${{matrix.build_type}} ${{env.UBUNTU_CLANG_VERSION}} -DBUILD_SHARED_LIBS=YES
|
||||
- name: Build
|
||||
run: cmake --build ${{github.workspace}}/Build/Linux_${{matrix.build_type}} -j $(nproc)
|
||||
- name: Test
|
||||
working-directory: ${{github.workspace}}/Build/Linux_${{matrix.build_type}}
|
||||
run: ctest --output-on-failure --verbose
|
||||
|
||||
linux-clang-32-bit:
|
||||
runs-on: ubuntu-24.04
|
||||
name: Linux Clang 32-bit
|
||||
strategy:
|
||||
fail-fast: false
|
||||
matrix:
|
||||
build_type: [Debug, Release, Distribution]
|
||||
|
||||
steps:
|
||||
- name: Checkout Code
|
||||
uses: actions/checkout@v6
|
||||
- name: Update APT
|
||||
run: sudo apt update
|
||||
- name: Install G++-Multilib
|
||||
run: sudo apt -y install g++-multilib
|
||||
- name: Configure CMake
|
||||
working-directory: ${{github.workspace}}/Build
|
||||
run: ./cmake_linux_clang_gcc.sh ${{matrix.build_type}} ${{env.UBUNTU_CLANG_VERSION}} -DCMAKE_CXX_FLAGS=-m32 -DUSE_SSE4_1=OFF -DUSE_SSE4_2=OFF -DUSE_AVX=OFF -DUSE_AVX2=OFF -DUSE_AVX512=OFF -DUSE_LZCNT=OFF -DUSE_TZCNT=OFF -DUSE_F16C=OFF -DUSE_FMADD=OFF
|
||||
- name: Build
|
||||
run: cmake --build ${{github.workspace}}/Build/Linux_${{matrix.build_type}} -j $(nproc)
|
||||
- name: Test
|
||||
working-directory: ${{github.workspace}}/Build/Linux_${{matrix.build_type}}
|
||||
run: ctest --output-on-failure --verbose
|
||||
|
||||
linux-clang-use-std-vector:
|
||||
runs-on: ubuntu-24.04
|
||||
name: Linux Clang using std::vector
|
||||
strategy:
|
||||
fail-fast: false
|
||||
matrix:
|
||||
build_type: [Debug, ReleaseASAN]
|
||||
double_precision: [Yes]
|
||||
|
||||
steps:
|
||||
- name: Checkout Code
|
||||
uses: actions/checkout@v6
|
||||
- name: Configure CMake
|
||||
working-directory: ${{github.workspace}}/Build
|
||||
run: ./cmake_linux_clang_gcc.sh ${{matrix.build_type}} ${{env.UBUNTU_CLANG_VERSION}} -DDOUBLE_PRECISION=${{matrix.double_precision}} -DUSE_STD_VECTOR=ON
|
||||
- name: Build
|
||||
run: cmake --build ${{github.workspace}}/Build/Linux_${{matrix.build_type}} -j $(nproc)
|
||||
- name: Test
|
||||
working-directory: ${{github.workspace}}/Build/Linux_${{matrix.build_type}}
|
||||
run: ctest --output-on-failure --verbose
|
||||
|
||||
linux-gcc:
|
||||
runs-on: ubuntu-24.04
|
||||
name: Linux GCC
|
||||
strategy:
|
||||
fail-fast: false
|
||||
matrix:
|
||||
build_type: [Debug, Release, Distribution]
|
||||
|
||||
steps:
|
||||
- name: Checkout Code
|
||||
uses: actions/checkout@v6
|
||||
- name: Install Vulkan
|
||||
run: ${{github.workspace}}/Build/ubuntu24_install_vulkan_sdk.sh
|
||||
- name: Configure CMake
|
||||
working-directory: ${{github.workspace}}/Build
|
||||
run: ./cmake_linux_clang_gcc.sh ${{matrix.build_type}} ${{env.UBUNTU_GCC_VERSION}}
|
||||
- name: Build
|
||||
run: cmake --build ${{github.workspace}}/Build/Linux_${{matrix.build_type}} -j $(nproc)
|
||||
- name: Test
|
||||
working-directory: ${{github.workspace}}/Build/Linux_${{matrix.build_type}}
|
||||
run: ctest --output-on-failure --verbose
|
||||
|
||||
linux-gcc-so:
|
||||
runs-on: ubuntu-24.04
|
||||
name: Linux GCC Shared Library
|
||||
strategy:
|
||||
fail-fast: false
|
||||
matrix:
|
||||
build_type: [Debug, Release, Distribution]
|
||||
|
||||
steps:
|
||||
- name: Checkout Code
|
||||
uses: actions/checkout@v6
|
||||
- name: Configure CMake
|
||||
working-directory: ${{github.workspace}}/Build
|
||||
run: ./cmake_linux_clang_gcc.sh ${{matrix.build_type}} ${{env.UBUNTU_GCC_VERSION}} -DBUILD_SHARED_LIBS=Yes
|
||||
- name: Build
|
||||
run: cmake --build ${{github.workspace}}/Build/Linux_${{matrix.build_type}} -j $(nproc)
|
||||
- name: Test
|
||||
working-directory: ${{github.workspace}}/Build/Linux_${{matrix.build_type}}
|
||||
run: ctest --output-on-failure --verbose
|
||||
|
||||
msys2_mingw_gcc:
|
||||
runs-on: windows-latest
|
||||
defaults:
|
||||
run:
|
||||
shell: msys2 {0}
|
||||
name: MSYS2 MinGW GCC
|
||||
strategy:
|
||||
fail-fast: false
|
||||
matrix:
|
||||
build_type: [Debug, Release]
|
||||
shared_lib: [No, Yes]
|
||||
|
||||
steps:
|
||||
- name: Checkout Code
|
||||
uses: actions/checkout@v6
|
||||
- name: Setup MSYS2
|
||||
uses: msys2/setup-msys2@v2
|
||||
with:
|
||||
msystem: mingw64
|
||||
install: mingw-w64-x86_64-toolchain mingw-w64-x86_64-cmake
|
||||
update: true
|
||||
- name: Configure CMake
|
||||
working-directory: ${{github.workspace}}/Build
|
||||
run: ./cmake_linux_mingw.sh ${{matrix.build_type}} -DBUILD_SHARED_LIBS=${{matrix.shared_lib}}
|
||||
- name: Build
|
||||
run: cmake --build Build/MinGW_${{matrix.build_type}} -j $(nproc)
|
||||
- name: Test
|
||||
working-directory: Build/MinGW_${{matrix.build_type}}
|
||||
run: ctest --output-on-failure --verbose
|
||||
|
||||
msvc_cl:
|
||||
runs-on: windows-latest
|
||||
name: Visual Studio CL
|
||||
strategy:
|
||||
fail-fast: false
|
||||
matrix:
|
||||
build_type: [Debug, Release, Distribution]
|
||||
double_precision: [No, Yes]
|
||||
|
||||
steps:
|
||||
- name: Checkout Code
|
||||
uses: actions/checkout@v6
|
||||
- name: Add msbuild to PATH
|
||||
uses: microsoft/setup-msbuild@v2
|
||||
- name: Configure CMake
|
||||
run: cmake -B ${{github.workspace}}/Build/VS2022_CL -G "Visual Studio 17 2022" -A x64 Build -DDOUBLE_PRECISION=${{matrix.double_precision}}
|
||||
- name: Build
|
||||
run: msbuild Build\VS2022_CL\JoltPhysics.sln /property:Configuration=${{matrix.build_type}} -m
|
||||
- name: Test
|
||||
working-directory: ${{github.workspace}}/Build/VS2022_CL/${{matrix.build_type}}
|
||||
run: ./UnitTests.exe
|
||||
|
||||
msvc_cl_no_object_stream:
|
||||
runs-on: windows-latest
|
||||
name: Visual Studio CL - No Object Stream
|
||||
strategy:
|
||||
fail-fast: false
|
||||
matrix:
|
||||
build_type: [Debug, Distribution]
|
||||
|
||||
steps:
|
||||
- name: Checkout Code
|
||||
uses: actions/checkout@v6
|
||||
- name: Add msbuild to PATH
|
||||
uses: microsoft/setup-msbuild@v2
|
||||
- name: Configure CMake
|
||||
run: cmake -B ${{github.workspace}}/Build/VS2022_CL -G "Visual Studio 17 2022" -A x64 Build -DENABLE_OBJECT_STREAM=NO
|
||||
- name: Build
|
||||
run: msbuild Build\VS2022_CL\JoltPhysics.sln /property:Configuration=${{matrix.build_type}} -m
|
||||
- name: Test
|
||||
working-directory: ${{github.workspace}}/Build/VS2022_CL/${{matrix.build_type}}
|
||||
run: ./UnitTests.exe
|
||||
|
||||
msvc_cl_dll:
|
||||
runs-on: windows-latest
|
||||
name: Visual Studio CL Shared Library
|
||||
strategy:
|
||||
fail-fast: false
|
||||
matrix:
|
||||
build_type: [Debug, Release, Distribution]
|
||||
|
||||
steps:
|
||||
- name: Checkout Code
|
||||
uses: actions/checkout@v6
|
||||
- name: Add msbuild to PATH
|
||||
uses: microsoft/setup-msbuild@v2
|
||||
- name: Configure CMake
|
||||
run: cmake -B ${{github.workspace}}/Build/VS2022_CL -G "Visual Studio 17 2022" -A x64 Build -DBUILD_SHARED_LIBS=Yes
|
||||
- name: Build
|
||||
run: msbuild Build\VS2022_CL\JoltPhysics.sln /property:Configuration=${{matrix.build_type}} -m
|
||||
- name: Test
|
||||
working-directory: ${{github.workspace}}/Build/VS2022_CL/${{matrix.build_type}}
|
||||
run: ./UnitTests.exe
|
||||
|
||||
msvc_cl_32_bit:
|
||||
runs-on: windows-latest
|
||||
name: Visual Studio CL 32-bit
|
||||
strategy:
|
||||
fail-fast: false
|
||||
matrix:
|
||||
build_type: [Debug, Release]
|
||||
|
||||
steps:
|
||||
- name: Checkout Code
|
||||
uses: actions/checkout@v6
|
||||
- name: Add msbuild to PATH
|
||||
uses: microsoft/setup-msbuild@v2
|
||||
- name: Configure CMake
|
||||
run: cmake -B ${{github.workspace}}/Build/VS2022_CL_32_BIT -G "Visual Studio 17 2022" -A Win32 -DUSE_SSE4_1=OFF -DUSE_SSE4_2=OFF -DUSE_AVX=OFF -DUSE_AVX2=OFF -DUSE_AVX512=OFF -DUSE_LZCNT=OFF -DUSE_TZCNT=OFF -DUSE_F16C=OFF -DUSE_FMADD=OFF Build
|
||||
- name: Build
|
||||
run: msbuild Build\VS2022_CL_32_BIT\JoltPhysics.sln /property:Configuration=${{matrix.build_type}} -m
|
||||
- name: Test
|
||||
working-directory: ${{github.workspace}}/Build/VS2022_CL_32_BIT/${{matrix.build_type}}
|
||||
run: ./UnitTests.exe
|
||||
|
||||
msvc_cl_arm:
|
||||
runs-on: windows-latest
|
||||
name: Visual Studio CL ARM
|
||||
strategy:
|
||||
fail-fast: false
|
||||
matrix:
|
||||
build_type: [Debug, Release]
|
||||
|
||||
steps:
|
||||
- name: Checkout Code
|
||||
uses: actions/checkout@v6
|
||||
- name: Add msbuild to PATH
|
||||
uses: microsoft/setup-msbuild@v2
|
||||
- name: Configure CMake
|
||||
run: cmake -B ${{github.workspace}}/Build/VS2022_CL_ARM -G "Visual Studio 17 2022" -A ARM64 Build
|
||||
- name: Build
|
||||
run: msbuild Build\VS2022_CL_ARM\JoltPhysics.sln /property:Configuration=${{matrix.build_type}} -m
|
||||
|
||||
msvc_cl_arm_32_bit:
|
||||
runs-on: windows-latest
|
||||
name: Visual Studio CL ARM 32-bit
|
||||
strategy:
|
||||
fail-fast: false
|
||||
matrix:
|
||||
build_type: [Debug, Release]
|
||||
|
||||
steps:
|
||||
- name: Checkout Code
|
||||
uses: actions/checkout@v6
|
||||
- name: Add msbuild to PATH
|
||||
uses: microsoft/setup-msbuild@v2
|
||||
- name: Install Windows 11 SDK (10.0.22621.0)
|
||||
# Alternative: Start-Process -wait -FilePath "C:\Program Files (x86)\Microsoft Visual Studio\Installer\vs_installer.exe" -ArgumentList "modify", "--installPath", """C:\Program Files\Microsoft Visual Studio\2022\Enterprise""", "--quiet", "--norestart", "--nocache", "--add", "Microsoft.VisualStudio.Component.Windows11SDK.22621" -Verb RunAs
|
||||
run: choco install windows-sdk-11-version-22H2-all -y
|
||||
- name: Configure CMake
|
||||
# Windows 11 SDK 10.0.22621.0 is the last SDK to support 32-bit ARM
|
||||
run: cmake -B ${{github.workspace}}/Build/VS2022_CL_ARM_32_BIT -G "Visual Studio 17 2022" -A ARM -DCMAKE_SYSTEM_VERSION="10.0.22621.0" -DCMAKE_CXX_COMPILER_WORKS=1 Build
|
||||
- name: Build
|
||||
run: msbuild Build\VS2022_CL_ARM_32_BIT\JoltPhysics.sln /property:Configuration=${{matrix.build_type}} -m
|
||||
|
||||
msvc_clang:
|
||||
runs-on: windows-latest
|
||||
name: Visual Studio Clang
|
||||
strategy:
|
||||
fail-fast: false
|
||||
matrix:
|
||||
build_type: [Debug, Release, Distribution]
|
||||
double_precision: [No, Yes]
|
||||
|
||||
steps:
|
||||
- name: Checkout Code
|
||||
uses: actions/checkout@v6
|
||||
- name: Add msbuild to PATH
|
||||
uses: microsoft/setup-msbuild@v2
|
||||
- name: Configure CMake
|
||||
run: cmake -B ${{github.workspace}}/Build/VS2022_Clang -G "Visual Studio 17 2022" -A x64 -T ClangCL Build -DDOUBLE_PRECISION=${{matrix.double_precision}}
|
||||
- name: Build
|
||||
run: msbuild Build\VS2022_Clang\JoltPhysics.sln /property:Configuration=${{matrix.build_type}} -m
|
||||
- name: Test
|
||||
working-directory: ${{github.workspace}}/Build/VS2022_Clang/${{matrix.build_type}}
|
||||
run: ./UnitTests.exe
|
||||
|
||||
macos:
|
||||
runs-on: macos-latest
|
||||
name: macOS
|
||||
env:
|
||||
VULKAN_SDK_INSTALL: ${{github.workspace}}/vulkan_sdk
|
||||
strategy:
|
||||
fail-fast: false
|
||||
matrix:
|
||||
build_type: [Debug, Release, Distribution]
|
||||
|
||||
steps:
|
||||
- name: Checkout Code
|
||||
uses: actions/checkout@v6
|
||||
- name: Install Vulkan
|
||||
run: ${{github.workspace}}/Build/macos_install_vulkan_sdk.sh ${VULKAN_SDK_INSTALL}
|
||||
- name: Configure CMake
|
||||
run: |
|
||||
source ${VULKAN_SDK_INSTALL}/setup-env.sh
|
||||
cmake -B ${{github.workspace}}/Build/MacOS_${{matrix.build_type}} -DCMAKE_BUILD_TYPE=${{matrix.build_type}} -DCMAKE_CXX_COMPILER=clang++ Build
|
||||
- name: Build
|
||||
run: cmake --build ${{github.workspace}}/Build/MacOS_${{matrix.build_type}} -j $(nproc)
|
||||
- name: Test
|
||||
working-directory: ${{github.workspace}}/Build/MacOS_${{matrix.build_type}}
|
||||
run: ctest --output-on-failure --verbose
|
||||
|
||||
android:
|
||||
runs-on: ubuntu-latest
|
||||
name: Android
|
||||
strategy:
|
||||
fail-fast: false
|
||||
|
||||
steps:
|
||||
- name: Checkout Code
|
||||
uses: actions/checkout@v6
|
||||
- name: Setup Java
|
||||
uses: actions/setup-java@v5
|
||||
with:
|
||||
distribution: 'temurin'
|
||||
java-version: '17'
|
||||
- name: Gradle Build
|
||||
working-directory: ${{github.workspace}}/Build/Android
|
||||
run: ./gradlew build --no-daemon
|
||||
|
||||
ios:
|
||||
runs-on: macos-latest
|
||||
name: iOS
|
||||
strategy:
|
||||
fail-fast: false
|
||||
|
||||
steps:
|
||||
- name: Checkout Code
|
||||
uses: actions/checkout@v6
|
||||
- name: Configure CMake
|
||||
run: cmake -B ${{github.workspace}}/Build/XCode_iOS -DTARGET_HELLO_WORLD=OFF -DTARGET_PERFORMANCE_TEST=OFF -DCMAKE_SYSTEM_NAME=iOS -GXcode Build
|
||||
- name: Build
|
||||
run: cmake --build ${{github.workspace}}/Build/XCode_iOS -- -sdk iphonesimulator -arch x86_64
|
||||
|
||||
emscripten:
|
||||
runs-on: ubuntu-latest
|
||||
name: Emscripten
|
||||
|
||||
steps:
|
||||
- name: Checkout Code
|
||||
uses: actions/checkout@v6
|
||||
- name: Setup emsdk
|
||||
uses: mymindstorm/setup-emsdk@v14
|
||||
with:
|
||||
version: ${{env.EMSCRIPTEN_VERSION}}
|
||||
- name: Verify emsdk
|
||||
run: emcc -v
|
||||
- name: Setup Node.js 18.x
|
||||
uses: actions/setup-node@v6
|
||||
with:
|
||||
node-version: 18.x
|
||||
- name: Configure CMake
|
||||
working-directory: ${{github.workspace}}/Build
|
||||
run: ./cmake_linux_emscripten.sh Distribution -DTARGET_HELLO_WORLD=OFF -DTARGET_PERFORMANCE_TEST=OFF
|
||||
- name: Build
|
||||
run: cmake --build ${{github.workspace}}/Build/WASM_Distribution -j $(nproc)
|
||||
- name: Test
|
||||
working-directory: ${{github.workspace}}/Build/WASM_Distribution
|
||||
run: node UnitTests.js
|
||||
@@ -0,0 +1,430 @@
|
||||
name: Determinism Check
|
||||
|
||||
env:
|
||||
CONVEX_VS_MESH_HASH: '0xa7348cad585544bf'
|
||||
RAGDOLL_HASH: '0xc392d8f867b0be5b'
|
||||
PYRAMID_HASH: '0xafd93b295e75e3f6'
|
||||
CHARACTER_VIRTUAL_HASH: '0x19c55223035a8f1a'
|
||||
EMSCRIPTEN_VERSION: 4.0.2
|
||||
NODE_VERSION: 23.x
|
||||
UBUNTU_CLANG_VERSION: clang++-18
|
||||
UBUNTU_GCC_VERSION: g++-14
|
||||
UBUNTU_GCC_AARCH64_VERSION: aarch64-linux-gnu-g++-14
|
||||
UBUNTU_GCC_RISCV_VERSION: riscv64-linux-gnu-g++-14
|
||||
UBUNTU_GCC_POWERPC_VERSION: powerpc64le-linux-gnu-g++-14
|
||||
UBUNTU_GCC_LOONGARCH_VERSION: loongarch64-linux-gnu-g++-14
|
||||
|
||||
on:
|
||||
push:
|
||||
branches: [ master ]
|
||||
paths-ignore:
|
||||
- 'Docs/**'
|
||||
- '**.md'
|
||||
pull_request:
|
||||
branches: [ master ]
|
||||
paths-ignore:
|
||||
- 'Docs/**'
|
||||
- '**.md'
|
||||
|
||||
jobs:
|
||||
linux_clang:
|
||||
runs-on: ubuntu-latest
|
||||
name: Linux Clang Determinism Check
|
||||
|
||||
steps:
|
||||
- name: Checkout Code
|
||||
uses: actions/checkout@v6
|
||||
- name: Configure CMake
|
||||
working-directory: ${{github.workspace}}/Build
|
||||
run: ./cmake_linux_clang_gcc.sh Distribution ${{env.UBUNTU_CLANG_VERSION}} -DCROSS_PLATFORM_DETERMINISTIC=ON -DTARGET_VIEWER=OFF -DTARGET_SAMPLES=OFF -DTARGET_HELLO_WORLD=OFF -DTARGET_UNIT_TESTS=ON -DTARGET_PERFORMANCE_TEST=ON
|
||||
- name: Build
|
||||
run: cmake --build ${{github.workspace}}/Build/Linux_Distribution -j $(nproc)
|
||||
- name: Unit Tests
|
||||
working-directory: ${{github.workspace}}/Build/Linux_Distribution
|
||||
run: ctest --output-on-failure --verbose
|
||||
- name: Test ConvexVsMesh
|
||||
working-directory: ${{github.workspace}}/Build/Linux_Distribution
|
||||
run: ./PerformanceTest -q=LinearCast -t=max -s=ConvexVsMesh -validate_hash=${CONVEX_VS_MESH_HASH}
|
||||
- name: Test Ragdoll
|
||||
working-directory: ${{github.workspace}}/Build/Linux_Distribution
|
||||
run: ./PerformanceTest -q=LinearCast -t=max -s=Ragdoll -validate_hash=${RAGDOLL_HASH}
|
||||
- name: Test Pyramid
|
||||
working-directory: ${{github.workspace}}/Build/Linux_Distribution
|
||||
run: ./PerformanceTest -q=LinearCast -t=max -s=Pyramid -validate_hash=${PYRAMID_HASH}
|
||||
- name: Test CharacterVirtual
|
||||
working-directory: ${{github.workspace}}/Build/Linux_Distribution
|
||||
run: ./PerformanceTest -q=Discrete -t=max -s=CharacterVirtual -validate_hash=${CHARACTER_VIRTUAL_HASH}
|
||||
|
||||
linux_gcc:
|
||||
runs-on: ubuntu-latest
|
||||
name: Linux GCC Determinism Check
|
||||
|
||||
steps:
|
||||
- name: Checkout Code
|
||||
uses: actions/checkout@v6
|
||||
- name: Configure CMake
|
||||
working-directory: ${{github.workspace}}/Build
|
||||
run: ./cmake_linux_clang_gcc.sh Distribution ${{env.UBUNTU_GCC_VERSION}} -DCROSS_PLATFORM_DETERMINISTIC=ON -DTARGET_VIEWER=OFF -DTARGET_SAMPLES=OFF -DTARGET_HELLO_WORLD=OFF -DTARGET_UNIT_TESTS=ON -DTARGET_PERFORMANCE_TEST=ON
|
||||
- name: Build
|
||||
run: cmake --build ${{github.workspace}}/Build/Linux_Distribution -j $(nproc)
|
||||
- name: Unit Tests
|
||||
working-directory: ${{github.workspace}}/Build/Linux_Distribution
|
||||
run: ctest --output-on-failure --verbose
|
||||
- name: Test ConvexVsMesh
|
||||
working-directory: ${{github.workspace}}/Build/Linux_Distribution
|
||||
run: ./PerformanceTest -q=LinearCast -t=max -s=ConvexVsMesh -validate_hash=${CONVEX_VS_MESH_HASH}
|
||||
- name: Test Ragdoll
|
||||
working-directory: ${{github.workspace}}/Build/Linux_Distribution
|
||||
run: ./PerformanceTest -q=LinearCast -t=max -s=Ragdoll -validate_hash=${RAGDOLL_HASH}
|
||||
- name: Test Pyramid
|
||||
working-directory: ${{github.workspace}}/Build/Linux_Distribution
|
||||
run: ./PerformanceTest -q=LinearCast -t=max -s=Pyramid -validate_hash=${PYRAMID_HASH}
|
||||
- name: Test CharacterVirtual
|
||||
working-directory: ${{github.workspace}}/Build/Linux_Distribution
|
||||
run: ./PerformanceTest -q=Discrete -t=max -s=CharacterVirtual -validate_hash=${CHARACTER_VIRTUAL_HASH}
|
||||
|
||||
msvc_cl:
|
||||
runs-on: windows-latest
|
||||
name: Visual Studio CL Determinism Check
|
||||
|
||||
steps:
|
||||
- name: Checkout Code
|
||||
uses: actions/checkout@v6
|
||||
- name: Add msbuild to PATH
|
||||
uses: microsoft/setup-msbuild@v2
|
||||
- name: Configure CMake
|
||||
working-directory: ${{github.workspace}}/Build
|
||||
run: ./cmake_vs2022_cl.bat -DCROSS_PLATFORM_DETERMINISTIC=ON -DTARGET_VIEWER=OFF -DTARGET_SAMPLES=OFF -DTARGET_HELLO_WORLD=OFF -DTARGET_UNIT_TESTS=ON -DTARGET_PERFORMANCE_TEST=ON
|
||||
- name: Build
|
||||
run: msbuild Build\VS2022_CL\JoltPhysics.sln /property:Configuration=Distribution
|
||||
- name: Unit Tests
|
||||
working-directory: ${{github.workspace}}/Build/VS2022_CL/Distribution
|
||||
run: ./UnitTests.exe
|
||||
- name: Test ConvexVsMesh
|
||||
working-directory: ${{github.workspace}}/Build/VS2022_CL/Distribution
|
||||
run: ./PerformanceTest -q=LinearCast -t=max -s=ConvexVsMesh "-validate_hash=$env:CONVEX_VS_MESH_HASH"
|
||||
- name: Test Ragdoll
|
||||
working-directory: ${{github.workspace}}/Build/VS2022_CL/Distribution
|
||||
run: ./PerformanceTest -q=LinearCast -t=max -s=Ragdoll "-validate_hash=$env:RAGDOLL_HASH"
|
||||
- name: Test Pyramid
|
||||
working-directory: ${{github.workspace}}/Build/VS2022_CL/Distribution
|
||||
run: ./PerformanceTest -q=LinearCast -t=max -s=Pyramid "-validate_hash=$env:PYRAMID_HASH"
|
||||
- name: Test CharacterVirtual
|
||||
working-directory: ${{github.workspace}}/Build/VS2022_CL/Distribution
|
||||
run: ./PerformanceTest -q=Discrete -t=max -s=CharacterVirtual "-validate_hash=$env:CHARACTER_VIRTUAL_HASH"
|
||||
|
||||
msvc_cl_32:
|
||||
runs-on: windows-latest
|
||||
name: Visual Studio CL 32-bit Determinism Check
|
||||
|
||||
steps:
|
||||
- name: Checkout Code
|
||||
uses: actions/checkout@v6
|
||||
- name: Add msbuild to PATH
|
||||
uses: microsoft/setup-msbuild@v2
|
||||
- name: Configure CMake
|
||||
working-directory: ${{github.workspace}}/Build
|
||||
run: ./cmake_vs2022_cl_32bit.bat -DCROSS_PLATFORM_DETERMINISTIC=ON -DTARGET_VIEWER=OFF -DTARGET_SAMPLES=OFF -DTARGET_HELLO_WORLD=OFF -DTARGET_UNIT_TESTS=ON -DTARGET_PERFORMANCE_TEST=ON
|
||||
- name: Build
|
||||
run: msbuild Build\VS2022_CL_32BIT\JoltPhysics.sln /property:Configuration=Distribution
|
||||
- name: Unit Tests
|
||||
working-directory: ${{github.workspace}}/Build/VS2022_CL_32BIT/Distribution
|
||||
run: ./UnitTests.exe
|
||||
- name: Test ConvexVsMesh
|
||||
working-directory: ${{github.workspace}}/Build/VS2022_CL_32BIT/Distribution
|
||||
run: ./PerformanceTest -q=LinearCast -t=max -s=ConvexVsMesh "-validate_hash=$env:CONVEX_VS_MESH_HASH"
|
||||
- name: Test Ragdoll
|
||||
working-directory: ${{github.workspace}}/Build/VS2022_CL_32BIT/Distribution
|
||||
run: ./PerformanceTest -q=LinearCast -t=max -s=Ragdoll "-validate_hash=$env:RAGDOLL_HASH"
|
||||
- name: Test Pyramid
|
||||
working-directory: ${{github.workspace}}/Build/VS2022_CL_32BIT/Distribution
|
||||
run: ./PerformanceTest -q=LinearCast -t=max -s=Pyramid "-validate_hash=$env:PYRAMID_HASH"
|
||||
- name: Test CharacterVirtual
|
||||
working-directory: ${{github.workspace}}/Build/VS2022_CL_32BIT/Distribution
|
||||
run: ./PerformanceTest -q=Discrete -t=max -s=CharacterVirtual "-validate_hash=$env:CHARACTER_VIRTUAL_HASH"
|
||||
|
||||
macos:
|
||||
runs-on: macos-latest
|
||||
name: macOS Determinism Check
|
||||
|
||||
steps:
|
||||
- name: Checkout Code
|
||||
uses: actions/checkout@v6
|
||||
- name: Configure CMake
|
||||
working-directory: ${{github.workspace}}/Build
|
||||
run: ./cmake_linux_clang_gcc.sh Distribution clang++ -DCROSS_PLATFORM_DETERMINISTIC=ON -DTARGET_VIEWER=OFF -DTARGET_SAMPLES=OFF -DTARGET_HELLO_WORLD=OFF -DTARGET_UNIT_TESTS=ON -DTARGET_PERFORMANCE_TEST=ON
|
||||
- name: Build
|
||||
run: cmake --build ${{github.workspace}}/Build/Linux_Distribution -j $(nproc)
|
||||
- name: Unit Tests
|
||||
working-directory: ${{github.workspace}}/Build/Linux_Distribution
|
||||
run: ctest --output-on-failure --verbose
|
||||
- name: Test ConvexVsMesh
|
||||
working-directory: ${{github.workspace}}/Build/Linux_Distribution
|
||||
run: ./PerformanceTest -q=LinearCast -t=max -s=ConvexVsMesh -validate_hash=${CONVEX_VS_MESH_HASH}
|
||||
- name: Test Ragdoll
|
||||
working-directory: ${{github.workspace}}/Build/Linux_Distribution
|
||||
run: ./PerformanceTest -q=LinearCast -t=max -s=Ragdoll -validate_hash=${RAGDOLL_HASH}
|
||||
- name: Test Pyramid
|
||||
working-directory: ${{github.workspace}}/Build/Linux_Distribution
|
||||
run: ./PerformanceTest -q=LinearCast -t=max -s=Pyramid -validate_hash=${PYRAMID_HASH}
|
||||
- name: Test CharacterVirtual
|
||||
working-directory: ${{github.workspace}}/Build/Linux_Distribution
|
||||
run: ./PerformanceTest -q=Discrete -t=max -s=CharacterVirtual -validate_hash=${CHARACTER_VIRTUAL_HASH}
|
||||
|
||||
arm_clang:
|
||||
runs-on: ubuntu-latest
|
||||
name: ARM Clang Determinism Check
|
||||
steps:
|
||||
- name: Checkout Code
|
||||
uses: actions/checkout@v6
|
||||
- name: Update index
|
||||
run: sudo apt-get update
|
||||
- name: Install Cross Compiler
|
||||
run: sudo apt-get install gcc-14-aarch64-linux-gnu gcc-14-multilib g++-14-multilib libstdc++-14-dev-arm64-cross qemu-user -y
|
||||
- name: Configure CMake
|
||||
working-directory: ${{github.workspace}}/Build
|
||||
run: ./cmake_linux_clang_gcc.sh Distribution ${{env.UBUNTU_CLANG_VERSION}} -DCROSS_COMPILE_ARM=ON -DCROSS_PLATFORM_DETERMINISTIC=ON -DTARGET_VIEWER=OFF -DTARGET_SAMPLES=OFF -DTARGET_HELLO_WORLD=OFF -DTARGET_UNIT_TESTS=ON -DTARGET_PERFORMANCE_TEST=ON
|
||||
- name: Build
|
||||
run: cmake --build ${{github.workspace}}/Build/Linux_Distribution -j $(nproc)
|
||||
- name: Unit Tests
|
||||
working-directory: ${{github.workspace}}/Build/Linux_Distribution
|
||||
run: qemu-aarch64 -L /usr/aarch64-linux-gnu/ ./UnitTests
|
||||
- name: Test ConvexVsMesh
|
||||
working-directory: ${{github.workspace}}/Build/Linux_Distribution
|
||||
run: qemu-aarch64 -L /usr/aarch64-linux-gnu/ ./PerformanceTest -q=LinearCast -t=max -s=ConvexVsMesh -validate_hash=${CONVEX_VS_MESH_HASH}
|
||||
- name: Test Ragdoll
|
||||
working-directory: ${{github.workspace}}/Build/Linux_Distribution
|
||||
run: qemu-aarch64 -L /usr/aarch64-linux-gnu/ ./PerformanceTest -q=LinearCast -t=max -s=Ragdoll -validate_hash=${RAGDOLL_HASH}
|
||||
- name: Test Pyramid
|
||||
working-directory: ${{github.workspace}}/Build/Linux_Distribution
|
||||
run: qemu-aarch64 -L /usr/aarch64-linux-gnu/ ./PerformanceTest -q=LinearCast -t=max -s=Pyramid -validate_hash=${PYRAMID_HASH}
|
||||
- name: Test CharacterVirtual
|
||||
working-directory: ${{github.workspace}}/Build/Linux_Distribution
|
||||
run: qemu-aarch64 -L /usr/aarch64-linux-gnu/ ./PerformanceTest -q=Discrete -t=max -s=CharacterVirtual -validate_hash=${CHARACTER_VIRTUAL_HASH}
|
||||
|
||||
arm_clang_32:
|
||||
runs-on: ubuntu-latest
|
||||
name: ARM Clang 32-bit Determinism Check
|
||||
steps:
|
||||
- name: Checkout Code
|
||||
uses: actions/checkout@v6
|
||||
- name: Update index
|
||||
run: sudo apt-get update
|
||||
- name: Install Cross Compiler
|
||||
run: sudo apt-get install g++-14-arm-linux-gnueabihf qemu-user -y
|
||||
- name: Configure CMake
|
||||
working-directory: ${{github.workspace}}/Build
|
||||
run: ./cmake_linux_clang_gcc.sh Distribution ${{env.UBUNTU_CLANG_VERSION}} -DCROSS_COMPILE_ARM=ON -DCROSS_COMPILE_ARM_TARGET="arm-linux-gnueabihf" -DCROSS_PLATFORM_DETERMINISTIC=ON -DTARGET_VIEWER=OFF -DTARGET_SAMPLES=OFF -DTARGET_HELLO_WORLD=OFF -DTARGET_UNIT_TESTS=ON -DTARGET_PERFORMANCE_TEST=ON
|
||||
- name: Build
|
||||
run: cmake --build ${{github.workspace}}/Build/Linux_Distribution -j $(nproc)
|
||||
- name: Unit Tests
|
||||
working-directory: ${{github.workspace}}/Build/Linux_Distribution
|
||||
run: qemu-arm -L /usr/arm-linux-gnueabihf/ ./UnitTests
|
||||
- name: Test ConvexVsMesh
|
||||
working-directory: ${{github.workspace}}/Build/Linux_Distribution
|
||||
run: qemu-arm -L /usr/arm-linux-gnueabihf/ ./PerformanceTest -q=LinearCast -t=max -s=ConvexVsMesh -validate_hash=${CONVEX_VS_MESH_HASH}
|
||||
- name: Test Ragdoll
|
||||
working-directory: ${{github.workspace}}/Build/Linux_Distribution
|
||||
run: qemu-arm -L /usr/arm-linux-gnueabihf/ ./PerformanceTest -q=LinearCast -t=max -s=Ragdoll -validate_hash=${RAGDOLL_HASH}
|
||||
- name: Test Pyramid
|
||||
working-directory: ${{github.workspace}}/Build/Linux_Distribution
|
||||
run: qemu-arm -L /usr/arm-linux-gnueabihf/ ./PerformanceTest -q=LinearCast -t=max -s=Pyramid -validate_hash=${PYRAMID_HASH}
|
||||
- name: Test CharacterVirtual
|
||||
working-directory: ${{github.workspace}}/Build/Linux_Distribution
|
||||
run: qemu-arm -L /usr/arm-linux-gnueabihf/ ./PerformanceTest -q=Discrete -t=max -s=CharacterVirtual -validate_hash=${CHARACTER_VIRTUAL_HASH}
|
||||
|
||||
arm_gcc:
|
||||
runs-on: ubuntu-latest
|
||||
name: ARM GCC Determinism Check
|
||||
steps:
|
||||
- name: Checkout Code
|
||||
uses: actions/checkout@v6
|
||||
- name: Update index
|
||||
run: sudo apt-get update
|
||||
- name: Install Cross Compiler
|
||||
run: sudo apt-get install g++-14-aarch64-linux-gnu gcc-14-multilib g++-14-multilib libstdc++-14-dev-arm64-cross qemu-user -y
|
||||
- name: Configure CMake
|
||||
working-directory: ${{github.workspace}}/Build
|
||||
run: ./cmake_linux_clang_gcc.sh Distribution ${{env.UBUNTU_GCC_AARCH64_VERSION}} -DCROSS_COMPILE_ARM=ON -DCROSS_PLATFORM_DETERMINISTIC=ON -DTARGET_VIEWER=OFF -DTARGET_SAMPLES=OFF -DTARGET_HELLO_WORLD=OFF -DTARGET_UNIT_TESTS=ON -DTARGET_PERFORMANCE_TEST=ON
|
||||
- name: Build
|
||||
run: cmake --build ${{github.workspace}}/Build/Linux_Distribution -j $(nproc)
|
||||
- name: Unit Tests
|
||||
working-directory: ${{github.workspace}}/Build/Linux_Distribution
|
||||
run: qemu-aarch64 -L /usr/aarch64-linux-gnu/ ./UnitTests
|
||||
- name: Test ConvexVsMesh
|
||||
working-directory: ${{github.workspace}}/Build/Linux_Distribution
|
||||
run: qemu-aarch64 -L /usr/aarch64-linux-gnu/ ./PerformanceTest -q=LinearCast -t=max -s=ConvexVsMesh -validate_hash=${CONVEX_VS_MESH_HASH}
|
||||
- name: Test Ragdoll
|
||||
working-directory: ${{github.workspace}}/Build/Linux_Distribution
|
||||
run: qemu-aarch64 -L /usr/aarch64-linux-gnu/ ./PerformanceTest -q=LinearCast -t=max -s=Ragdoll -validate_hash=${RAGDOLL_HASH}
|
||||
- name: Test Pyramid
|
||||
working-directory: ${{github.workspace}}/Build/Linux_Distribution
|
||||
run: qemu-aarch64 -L /usr/aarch64-linux-gnu/ ./PerformanceTest -q=LinearCast -t=max -s=Pyramid -validate_hash=${PYRAMID_HASH}
|
||||
- name: Test CharacterVirtual
|
||||
working-directory: ${{github.workspace}}/Build/Linux_Distribution
|
||||
run: qemu-aarch64 -L /usr/aarch64-linux-gnu/ ./PerformanceTest -q=Discrete -t=max -s=CharacterVirtual -validate_hash=${CHARACTER_VIRTUAL_HASH}
|
||||
|
||||
riscv_gcc:
|
||||
runs-on: ubuntu-latest
|
||||
name: RISC-V GCC Determinism Check
|
||||
steps:
|
||||
- name: Checkout Code
|
||||
uses: actions/checkout@v6
|
||||
- name: Update index
|
||||
run: sudo apt-get update
|
||||
- name: Install Cross Compiler
|
||||
run: sudo apt-get install g++-14-riscv64-linux-gnu gcc-14-multilib g++-14-multilib qemu-user -y
|
||||
- name: Configure CMake
|
||||
working-directory: ${{github.workspace}}/Build
|
||||
run: ./cmake_linux_clang_gcc.sh Distribution ${{env.UBUNTU_GCC_RISCV_VERSION}} -DCROSS_COMPILE_ARM=ON -DCROSS_PLATFORM_DETERMINISTIC=ON -DCROSS_COMPILE_ARM_TARGET="" -DTARGET_VIEWER=OFF -DTARGET_SAMPLES=OFF -DTARGET_HELLO_WORLD=OFF -DTARGET_UNIT_TESTS=ON -DTARGET_PERFORMANCE_TEST=ON
|
||||
- name: Build
|
||||
run: cmake --build ${{github.workspace}}/Build/Linux_Distribution -j $(nproc)
|
||||
- name: Unit Tests
|
||||
working-directory: ${{github.workspace}}/Build/Linux_Distribution
|
||||
run: qemu-riscv64 -L /usr/riscv64-linux-gnu/ ./UnitTests
|
||||
- name: Test ConvexVsMesh
|
||||
working-directory: ${{github.workspace}}/Build/Linux_Distribution
|
||||
run: qemu-riscv64 -L /usr/riscv64-linux-gnu/ ./PerformanceTest -q=LinearCast -t=max -s=ConvexVsMesh -validate_hash=${CONVEX_VS_MESH_HASH}
|
||||
- name: Test Ragdoll
|
||||
working-directory: ${{github.workspace}}/Build/Linux_Distribution
|
||||
run: qemu-riscv64 -L /usr/riscv64-linux-gnu/ ./PerformanceTest -q=LinearCast -t=max -s=Ragdoll -validate_hash=${RAGDOLL_HASH}
|
||||
- name: Test Pyramid
|
||||
working-directory: ${{github.workspace}}/Build/Linux_Distribution
|
||||
run: qemu-riscv64 -L /usr/riscv64-linux-gnu/ ./PerformanceTest -q=LinearCast -t=max -s=Pyramid -validate_hash=${PYRAMID_HASH}
|
||||
- name: Test CharacterVirtual
|
||||
working-directory: ${{github.workspace}}/Build/Linux_Distribution
|
||||
run: qemu-riscv64 -L /usr/riscv64-linux-gnu/ ./PerformanceTest -q=Discrete -t=max -s=CharacterVirtual -validate_hash=${CHARACTER_VIRTUAL_HASH}
|
||||
|
||||
powerpcle_gcc:
|
||||
runs-on: ubuntu-latest
|
||||
name: PowerPC Little Endian GCC Determinism Check
|
||||
steps:
|
||||
- name: Checkout Code
|
||||
uses: actions/checkout@v6
|
||||
- name: Update index
|
||||
run: sudo apt-get update
|
||||
- name: Install Cross Compiler
|
||||
run: sudo apt-get install g++-14-powerpc64le-linux-gnu gcc-14-multilib g++-14-multilib qemu-user -y
|
||||
- name: Configure CMake
|
||||
working-directory: ${{github.workspace}}/Build
|
||||
run: ./cmake_linux_clang_gcc.sh Distribution ${{env.UBUNTU_GCC_POWERPC_VERSION}} -DCROSS_COMPILE_ARM=ON -DCROSS_PLATFORM_DETERMINISTIC=ON -DCROSS_COMPILE_ARM_TARGET="" -DTARGET_VIEWER=OFF -DTARGET_SAMPLES=OFF -DTARGET_HELLO_WORLD=OFF -DTARGET_UNIT_TESTS=ON -DTARGET_PERFORMANCE_TEST=ON
|
||||
- name: Build
|
||||
run: cmake --build ${{github.workspace}}/Build/Linux_Distribution -j $(nproc)
|
||||
- name: Unit Tests
|
||||
working-directory: ${{github.workspace}}/Build/Linux_Distribution
|
||||
run: qemu-ppc64le -L /usr/powerpc64le-linux-gnu/ ./UnitTests
|
||||
- name: Test ConvexVsMesh
|
||||
working-directory: ${{github.workspace}}/Build/Linux_Distribution
|
||||
run: qemu-ppc64le -L /usr/powerpc64le-linux-gnu/ ./PerformanceTest -q=LinearCast -t=max -s=ConvexVsMesh -validate_hash=${CONVEX_VS_MESH_HASH}
|
||||
# This is really slow so disabled for the moment
|
||||
# - name: Test Ragdoll
|
||||
# working-directory: ${{github.workspace}}/Build/Linux_Distribution
|
||||
# run: qemu-ppc64le -L /usr/powerpc64le-linux-gnu/ ./PerformanceTest -q=LinearCast -t=max -s=Ragdoll -validate_hash=${RAGDOLL_HASH}
|
||||
# - name: Test Pyramid
|
||||
# working-directory: ${{github.workspace}}/Build/Linux_Distribution
|
||||
# run: qemu-ppc64le -L /usr/powerpc64le-linux-gnu/ ./PerformanceTest -q=LinearCast -t=max -s=Pyramid -validate_hash=${PYRAMID_HASH}
|
||||
|
||||
loongarch_gcc:
|
||||
runs-on: ubuntu-latest
|
||||
name: LoongArch GCC Determinism Check
|
||||
steps:
|
||||
- name: Checkout Code
|
||||
uses: actions/checkout@v6
|
||||
- name: Update index
|
||||
run: sudo apt-get update
|
||||
- name: Install Cross Compiler
|
||||
run: sudo apt-get install g++-14-loongarch64-linux-gnu gcc-14-multilib g++-14-multilib qemu-user -y
|
||||
- name: Configure CMake
|
||||
working-directory: ${{github.workspace}}/Build
|
||||
run: ./cmake_linux_clang_gcc.sh Distribution ${{env.UBUNTU_GCC_LOONGARCH_VERSION}} -DCROSS_COMPILE_ARM=ON -DCROSS_PLATFORM_DETERMINISTIC=ON -DCROSS_COMPILE_ARM_TARGET="" -DTARGET_VIEWER=OFF -DTARGET_SAMPLES=OFF -DTARGET_HELLO_WORLD=OFF -DTARGET_UNIT_TESTS=ON -DTARGET_PERFORMANCE_TEST=ON
|
||||
- name: Build
|
||||
run: cmake --build ${{github.workspace}}/Build/Linux_Distribution -j $(nproc)
|
||||
- name: Unit Tests
|
||||
working-directory: ${{github.workspace}}/Build/Linux_Distribution
|
||||
run: qemu-loongarch64 -L /usr/loongarch64-linux-gnu/ ./UnitTests
|
||||
- name: Test ConvexVsMesh
|
||||
working-directory: ${{github.workspace}}/Build/Linux_Distribution
|
||||
run: qemu-loongarch64 -L /usr/loongarch64-linux-gnu/ ./PerformanceTest -q=LinearCast -t=max -s=ConvexVsMesh -validate_hash=${CONVEX_VS_MESH_HASH}
|
||||
- name: Test Ragdoll
|
||||
working-directory: ${{github.workspace}}/Build/Linux_Distribution
|
||||
run: qemu-loongarch64 -L /usr/loongarch64-linux-gnu/ ./PerformanceTest -q=LinearCast -t=max -s=Ragdoll -validate_hash=${RAGDOLL_HASH}
|
||||
# This is slow so disabled for the moment
|
||||
# - name: Test Pyramid
|
||||
# working-directory: ${{github.workspace}}/Build/Linux_Distribution
|
||||
# run: qemu-loongarch64 -L /usr/loongarch64-linux-gnu/ ./PerformanceTest -q=LinearCast -t=max -s=Pyramid -validate_hash=${PYRAMID_HASH}
|
||||
|
||||
emscripten:
|
||||
runs-on: ubuntu-latest
|
||||
name: Emscripten WASM32 Determinism Check
|
||||
|
||||
steps:
|
||||
- name: Checkout Code
|
||||
uses: actions/checkout@v6
|
||||
- name: Setup emsdk
|
||||
uses: mymindstorm/setup-emsdk@v14
|
||||
with:
|
||||
version: ${{env.EMSCRIPTEN_VERSION}}
|
||||
- name: Verify emsdk
|
||||
run: emcc -v
|
||||
- name: Setup Node.js ${{env.NODE_VERSION}}
|
||||
uses: actions/setup-node@v6
|
||||
with:
|
||||
node-version: ${{env.NODE_VERSION}}
|
||||
- name: Configure CMake
|
||||
working-directory: ${{github.workspace}}/Build
|
||||
run: ./cmake_linux_emscripten.sh Distribution -DCROSS_PLATFORM_DETERMINISTIC=ON -DTARGET_VIEWER=OFF -DTARGET_SAMPLES=OFF -DTARGET_HELLO_WORLD=OFF -DTARGET_UNIT_TESTS=ON -DTARGET_PERFORMANCE_TEST=ON
|
||||
- name: Build
|
||||
run: cmake --build ${{github.workspace}}/Build/WASM_Distribution -j $(nproc)
|
||||
- name: Unit Tests
|
||||
working-directory: ${{github.workspace}}/Build/WASM_Distribution
|
||||
run: node UnitTests.js
|
||||
- name: Test ConvexVsMesh
|
||||
working-directory: ${{github.workspace}}/Build/WASM_Distribution
|
||||
run: node PerformanceTest.js -q=LinearCast -t=max -s=ConvexVsMesh -validate_hash=${CONVEX_VS_MESH_HASH}
|
||||
- name: Test Ragdoll
|
||||
working-directory: ${{github.workspace}}/Build/WASM_Distribution
|
||||
run: node PerformanceTest.js -q=LinearCast -t=max -s=Ragdoll -validate_hash=${RAGDOLL_HASH}
|
||||
- name: Test Pyramid
|
||||
working-directory: ${{github.workspace}}/Build/WASM_Distribution
|
||||
run: node PerformanceTest.js -q=LinearCast -t=max -s=Pyramid -validate_hash=${PYRAMID_HASH}
|
||||
- name: Test CharacterVirtual
|
||||
working-directory: ${{github.workspace}}/Build/WASM_Distribution
|
||||
run: node PerformanceTest.js -q=Discrete -t=max -s=CharacterVirtual -validate_hash=${CHARACTER_VIRTUAL_HASH}
|
||||
|
||||
emscripten64:
|
||||
runs-on: ubuntu-latest
|
||||
name: Emscripten WASM64 Determinism Check
|
||||
|
||||
steps:
|
||||
- name: Checkout Code
|
||||
uses: actions/checkout@v6
|
||||
- name: Setup emsdk
|
||||
uses: mymindstorm/setup-emsdk@v14
|
||||
with:
|
||||
version: ${{env.EMSCRIPTEN_VERSION}}
|
||||
- name: Verify emsdk
|
||||
run: emcc -v
|
||||
- name: Setup Node.js ${{env.NODE_VERSION}}
|
||||
uses: actions/setup-node@v6
|
||||
with:
|
||||
node-version: ${{env.NODE_VERSION}}
|
||||
- name: Configure CMake
|
||||
working-directory: ${{github.workspace}}/Build
|
||||
run: ./cmake_linux_emscripten.sh Distribution -DCROSS_PLATFORM_DETERMINISTIC=ON -DTARGET_VIEWER=OFF -DTARGET_SAMPLES=OFF -DTARGET_HELLO_WORLD=OFF -DTARGET_UNIT_TESTS=ON -DTARGET_PERFORMANCE_TEST=ON -DJPH_USE_WASM64=ON
|
||||
- name: Build
|
||||
run: cmake --build ${{github.workspace}}/Build/WASM_Distribution -j $(nproc)
|
||||
- name: Unit Tests
|
||||
working-directory: ${{github.workspace}}/Build/WASM_Distribution
|
||||
run: node --experimental-wasm-memory64 UnitTests.js
|
||||
- name: Test ConvexVsMesh
|
||||
working-directory: ${{github.workspace}}/Build/WASM_Distribution
|
||||
run: node --experimental-wasm-memory64 PerformanceTest.js -q=LinearCast -t=max -s=ConvexVsMesh -validate_hash=${CONVEX_VS_MESH_HASH}
|
||||
- name: Test Ragdoll
|
||||
working-directory: ${{github.workspace}}/Build/WASM_Distribution
|
||||
run: node --experimental-wasm-memory64 PerformanceTest.js -q=LinearCast -t=max -s=Ragdoll -validate_hash=${RAGDOLL_HASH}
|
||||
- name: Test Pyramid
|
||||
working-directory: ${{github.workspace}}/Build/WASM_Distribution
|
||||
run: node --experimental-wasm-memory64 PerformanceTest.js -q=LinearCast -t=max -s=Pyramid -validate_hash=${PYRAMID_HASH}
|
||||
- name: Test CharacterVirtual
|
||||
working-directory: ${{github.workspace}}/Build/WASM_Distribution
|
||||
run: node --experimental-wasm-memory64 PerformanceTest.js -q=Discrete -t=max -s=CharacterVirtual -validate_hash=${CHARACTER_VIRTUAL_HASH}
|
||||
+26
@@ -0,0 +1,26 @@
|
||||
name: Doxygen Action
|
||||
|
||||
on:
|
||||
push:
|
||||
branches: [ master ]
|
||||
|
||||
# Builds and deploys doxygen documentation
|
||||
jobs:
|
||||
build:
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@v6
|
||||
|
||||
- name: Doxygen Action
|
||||
uses: mattnotmitt/doxygen-action@v1.12.0
|
||||
with:
|
||||
doxyfile-path: "./Doxyfile"
|
||||
working-directory: "."
|
||||
|
||||
- name: Deploy
|
||||
uses: peaceiris/actions-gh-pages@v4
|
||||
with:
|
||||
github_token: ${{ secrets.GITHUB_TOKEN }}
|
||||
publish_dir: ./Build/Doxygen
|
||||
force_orphan: true
|
||||
@@ -0,0 +1,58 @@
|
||||
name: Sonar Cloud
|
||||
|
||||
on:
|
||||
push:
|
||||
branches: [ master ]
|
||||
paths-ignore:
|
||||
- 'Docs/**'
|
||||
- '**.md'
|
||||
pull_request:
|
||||
branches: [ master ]
|
||||
paths-ignore:
|
||||
- 'Docs/**'
|
||||
- '**.md'
|
||||
|
||||
jobs:
|
||||
check-secret:
|
||||
runs-on: ubuntu-latest
|
||||
outputs:
|
||||
sonar-token: ${{ steps.sonar-token.outputs.defined }}
|
||||
steps:
|
||||
- id: sonar-token
|
||||
if: ${{ env.SONAR_TOKEN != '' }}
|
||||
run: echo "defined=true" >> $GITHUB_OUTPUT
|
||||
env:
|
||||
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
|
||||
|
||||
build:
|
||||
name: Build
|
||||
needs: [check-secret]
|
||||
if: needs.check-secret.outputs.sonar-token == 'true'
|
||||
runs-on: ubuntu-latest
|
||||
env:
|
||||
BUILD_WRAPPER_OUT_DIR: build_wrapper_output_directory # Directory where build-wrapper output will be placed
|
||||
CLANG_VERSION: 18
|
||||
steps:
|
||||
- uses: actions/checkout@v6
|
||||
with:
|
||||
fetch-depth: 0 # Shallow clones should be disabled for a better relevancy of analysis
|
||||
- name: Install build-wrapper
|
||||
uses: SonarSource/sonarqube-scan-action/install-build-wrapper@v7
|
||||
- name: Configure CMake
|
||||
working-directory: ${{github.workspace}}/Build
|
||||
run: ./cmake_linux_clang_gcc.sh ReleaseCoverage clang++-${{ env.CLANG_VERSION }}
|
||||
- name: Run build-wrapper
|
||||
run: build-wrapper-linux-x86-64 --out-dir ${{ env.BUILD_WRAPPER_OUT_DIR }} cmake --build ${{github.workspace}}/Build/Linux_ReleaseCoverage -j $(nproc)
|
||||
- name: Run unit tests and create coverage report
|
||||
working-directory: ${{github.workspace}}/Build/Linux_ReleaseCoverage
|
||||
run: |
|
||||
cmake --build . --target test -j $(nproc)
|
||||
llvm-profdata-${{ env.CLANG_VERSION }} merge -sparse default.profraw -o default.profdata
|
||||
llvm-cov-${{ env.CLANG_VERSION }} show -format=text UnitTests -instr-profile=default.profdata > coverage.txt
|
||||
- name: Run sonar-scanner
|
||||
uses: SonarSource/sonarqube-scan-action@v7
|
||||
env:
|
||||
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
|
||||
with:
|
||||
args: >
|
||||
--define sonar.cfamily.compile-commands=${{ env.BUILD_WRAPPER_OUT_DIR }}/compile_commands.json --define sonar.cfamily.llvm-cov.reportPath=${{github.workspace}}/Build/Linux_ReleaseCoverage/coverage.txt
|
||||
Vendored
+14
@@ -0,0 +1,14 @@
|
||||
.cache/
|
||||
.clangd/
|
||||
.fleet/
|
||||
.idea/
|
||||
.vs
|
||||
.vscode
|
||||
.DS_Store
|
||||
/profile_chart_*.html
|
||||
/stats*.html
|
||||
/snapshot.bin
|
||||
/*.jor
|
||||
/detlog.txt
|
||||
/Assets/Shaders/VK/*.spv
|
||||
/Assets/Shaders/MTL/*.metallib
|
||||
Binary file not shown.
Vendored
+1654
File diff suppressed because it is too large
Load Diff
+131
@@ -0,0 +1,131 @@
|
||||
TOS 1.00
|
||||
|
||||
declare SkeletalAnimation 1
|
||||
mAnimatedJoints array instance SkeletalAnimation::AnimatedJoint
|
||||
|
||||
declare SkeletalAnimation::AnimatedJoint 2
|
||||
mJointName string
|
||||
mKeyframes array instance SkeletalAnimation::Keyframe
|
||||
|
||||
declare SkeletalAnimation::Keyframe 3
|
||||
mRotation quat
|
||||
mTranslation vec3
|
||||
mTime float
|
||||
|
||||
object SkeletalAnimation 00000001
|
||||
23
|
||||
"hipsBone"
|
||||
1
|
||||
-0.580907 0.662465 0.472926 -0.005293
|
||||
-0.511629 0.123338 0.102563
|
||||
0.000000
|
||||
"R_Leg_sjnt_0"
|
||||
1
|
||||
0.994683 0.029515 -0.098649 -0.001901
|
||||
-0.104854 -0.000224 0.000080
|
||||
0.000000
|
||||
"R_Leg_sjnt_1"
|
||||
1
|
||||
0.558236 0.082819 0.102170 0.819191
|
||||
-0.000000 0.461809 0.000000
|
||||
0.000000
|
||||
"R_Foot_sjnt_0"
|
||||
1
|
||||
-0.415795 -0.025903 -0.285547 0.863080
|
||||
0.000000 0.388174 0.000000
|
||||
0.000000
|
||||
"L_Leg_sjnt_0"
|
||||
1
|
||||
-0.096847 0.200302 0.053881 0.973446
|
||||
0.104854 -0.000225 0.000080
|
||||
0.000000
|
||||
"L_Leg_sjnt_1"
|
||||
1
|
||||
0.625317 0.040626 -0.068376 0.776307
|
||||
0.000000 -0.461808 0.000000
|
||||
0.000000
|
||||
"L_Foot_sjnt_0"
|
||||
1
|
||||
0.448028 0.016552 0.068711 -0.891222
|
||||
-0.000001 -0.388173 -0.000000
|
||||
0.000000
|
||||
"C_Spine_sjnt_0"
|
||||
1
|
||||
0.031433 -0.000518 -0.001091 0.999505
|
||||
-0.000000 0.055442 -0.000000
|
||||
0.000000
|
||||
"C_Spine_sjnt_1"
|
||||
1
|
||||
0.062272 0.003369 -0.006740 0.998031
|
||||
-0.000000 0.049000 0.000000
|
||||
0.000000
|
||||
"C_Spine_sjnt_2"
|
||||
1
|
||||
0.093196 0.002904 -0.011009 0.995583
|
||||
0.000000 0.049000 -0.000000
|
||||
0.000000
|
||||
"C_Spine_sjnt_4"
|
||||
1
|
||||
0.092643 0.004648 -0.011669 0.995620
|
||||
0.000000 0.098001 0.000000
|
||||
0.000000
|
||||
"L_Clavicle_sjnt_0"
|
||||
1
|
||||
0.856473 -0.498143 0.097625 0.093688
|
||||
0.007299 0.208857 0.030677
|
||||
0.000000
|
||||
"L_Arm_sjnt_0"
|
||||
1
|
||||
0.051326 0.583453 0.540585 0.603918
|
||||
0.070455 -0.150703 0.005819
|
||||
0.000000
|
||||
"L_Arm_sjnt_1"
|
||||
1
|
||||
0.749181 -0.055037 -0.190752 0.631912
|
||||
-0.000001 -0.260631 0.000000
|
||||
0.000000
|
||||
"L_Wrist_sjnt_0"
|
||||
1
|
||||
0.000688 -0.106898 0.049180 -0.993053
|
||||
0.000007 -0.242273 0.000003
|
||||
0.000000
|
||||
"R_Clavicle_sjnt_0"
|
||||
1
|
||||
-0.076883 -0.107965 0.509223 0.850367
|
||||
-0.007299 0.208857 0.030677
|
||||
0.000000
|
||||
"R_Arm_sjnt_0"
|
||||
1
|
||||
0.622778 -0.313061 0.547977 0.462453
|
||||
-0.070458 0.150703 -0.005820
|
||||
0.000000
|
||||
"R_Arm_sjnt_1"
|
||||
1
|
||||
0.570264 -0.066970 -0.307114 0.758944
|
||||
-0.000001 0.260632 -0.000000
|
||||
0.000000
|
||||
"R_Wrist_sjnt_0"
|
||||
1
|
||||
-0.107633 -0.182094 -0.068157 -0.974993
|
||||
0.000000 0.242268 -0.000000
|
||||
0.000000
|
||||
"C_Neck_sjnt_0"
|
||||
1
|
||||
0.148132 0.042497 -0.052729 0.986646
|
||||
0.000000 0.206349 -0.038118
|
||||
0.000000
|
||||
"C_Neck_sjnt_1"
|
||||
1
|
||||
-0.272572 0.021316 -0.048793 0.960661
|
||||
-0.000000 0.054000 0.000000
|
||||
0.000000
|
||||
"C_Neck_sjnt_2"
|
||||
1
|
||||
-0.054183 -0.008292 -0.029041 0.998074
|
||||
0.000000 0.054001 0.000000
|
||||
0.000000
|
||||
"C_Head_sjnt_0"
|
||||
1
|
||||
0.029305 0.088480 -0.137100 0.986162
|
||||
0.000000 0.054000 -0.000000
|
||||
0.000000
|
||||
+131
@@ -0,0 +1,131 @@
|
||||
TOS 1.00
|
||||
|
||||
declare SkeletalAnimation 1
|
||||
mAnimatedJoints array instance SkeletalAnimation::AnimatedJoint
|
||||
|
||||
declare SkeletalAnimation::AnimatedJoint 2
|
||||
mJointName string
|
||||
mKeyframes array instance SkeletalAnimation::Keyframe
|
||||
|
||||
declare SkeletalAnimation::Keyframe 3
|
||||
mRotation quat
|
||||
mTranslation vec3
|
||||
mTime float
|
||||
|
||||
object SkeletalAnimation 00000001
|
||||
23
|
||||
"hipsBone"
|
||||
1
|
||||
0.580969 0.662434 0.472893 0.005230
|
||||
0.778002 0.123338 0.121363
|
||||
0.000000
|
||||
"R_Leg_sjnt_0"
|
||||
1
|
||||
-0.979544 0.029720 -0.196361 -0.032433
|
||||
-0.104854 -0.000224 0.000080
|
||||
0.000000
|
||||
"R_Leg_sjnt_1"
|
||||
1
|
||||
0.607629 0.107933 -0.014707 0.786715
|
||||
-0.000000 0.461809 0.000000
|
||||
0.000000
|
||||
"R_Foot_sjnt_0"
|
||||
1
|
||||
-0.601232 0.033798 -0.038697 0.797421
|
||||
0.000000 0.388174 0.000000
|
||||
0.000000
|
||||
"L_Leg_sjnt_0"
|
||||
1
|
||||
0.047909 -0.102469 -0.016701 0.993441
|
||||
0.104854 -0.000225 0.000080
|
||||
0.000000
|
||||
"L_Leg_sjnt_1"
|
||||
1
|
||||
-0.491497 -0.068754 -0.078845 -0.864573
|
||||
0.000000 -0.461808 0.000000
|
||||
0.000000
|
||||
"L_Foot_sjnt_0"
|
||||
1
|
||||
0.390997 -0.045090 0.421830 -0.816791
|
||||
-0.000001 -0.388173 -0.000000
|
||||
0.000000
|
||||
"C_Spine_sjnt_0"
|
||||
1
|
||||
0.031433 0.000503 0.001038 0.999505
|
||||
-0.000000 0.055442 0.000000
|
||||
0.000000
|
||||
"C_Spine_sjnt_1"
|
||||
1
|
||||
0.062272 -0.003358 0.006714 0.998031
|
||||
-0.000000 0.049000 0.000000
|
||||
0.000000
|
||||
"C_Spine_sjnt_2"
|
||||
1
|
||||
0.093197 -0.002900 0.010957 0.995583
|
||||
0.000000 0.049000 -0.000000
|
||||
0.000000
|
||||
"C_Spine_sjnt_4"
|
||||
1
|
||||
-0.092643 0.004635 -0.011603 -0.995621
|
||||
0.000000 0.098001 -0.000000
|
||||
0.000000
|
||||
"L_Clavicle_sjnt_0"
|
||||
1
|
||||
-0.850361 0.509199 0.108046 -0.077000
|
||||
0.007299 0.208857 0.030677
|
||||
0.000000
|
||||
"L_Arm_sjnt_0"
|
||||
1
|
||||
0.622797 -0.313095 0.547896 0.462500
|
||||
0.070455 -0.150703 0.005820
|
||||
0.000000
|
||||
"L_Arm_sjnt_1"
|
||||
1
|
||||
-0.570276 0.066909 0.307092 -0.758948
|
||||
-0.000001 -0.260631 -0.000000
|
||||
0.000000
|
||||
"L_Wrist_sjnt_0"
|
||||
1
|
||||
0.107622 0.182086 0.068178 0.974994
|
||||
0.000007 -0.242273 0.000002
|
||||
0.000000
|
||||
"R_Clavicle_sjnt_0"
|
||||
1
|
||||
-0.093524 0.097713 0.498124 0.856492
|
||||
-0.007299 0.208857 0.030677
|
||||
0.000000
|
||||
"R_Arm_sjnt_0"
|
||||
1
|
||||
0.051326 0.583528 0.540453 0.603963
|
||||
-0.070458 0.150703 -0.005820
|
||||
0.000000
|
||||
"R_Arm_sjnt_1"
|
||||
1
|
||||
-0.749170 0.055080 0.190723 -0.631930
|
||||
-0.000001 0.260632 0.000000
|
||||
0.000000
|
||||
"R_Wrist_sjnt_0"
|
||||
1
|
||||
-0.000687 0.106883 -0.049184 0.993054
|
||||
0.000000 0.242268 -0.000000
|
||||
0.000000
|
||||
"C_Neck_sjnt_0"
|
||||
1
|
||||
0.148136 -0.042494 0.052637 0.986651
|
||||
-0.000000 0.206349 -0.038118
|
||||
0.000000
|
||||
"C_Neck_sjnt_1"
|
||||
1
|
||||
-0.272569 -0.021317 0.048735 0.960665
|
||||
0.000000 0.054001 0.000000
|
||||
0.000000
|
||||
"C_Neck_sjnt_2"
|
||||
1
|
||||
-0.054186 0.008273 0.028994 0.998076
|
||||
0.000000 0.054001 0.000000
|
||||
0.000000
|
||||
"C_Head_sjnt_0"
|
||||
1
|
||||
0.029319 -0.088467 0.137075 0.986167
|
||||
0.000000 0.054000 -0.000000
|
||||
0.000000
|
||||
+131
@@ -0,0 +1,131 @@
|
||||
TOS 1.00
|
||||
|
||||
declare SkeletalAnimation 1
|
||||
mAnimatedJoints array instance SkeletalAnimation::AnimatedJoint
|
||||
|
||||
declare SkeletalAnimation::AnimatedJoint 2
|
||||
mJointName string
|
||||
mKeyframes array instance SkeletalAnimation::Keyframe
|
||||
|
||||
declare SkeletalAnimation::Keyframe 3
|
||||
mRotation quat
|
||||
mTranslation vec3
|
||||
mTime float
|
||||
|
||||
object SkeletalAnimation 00000001
|
||||
23
|
||||
"hipsBone"
|
||||
1
|
||||
-0.253414 0.715602 -0.639670 0.120488
|
||||
-0.113085 0.196785 -0.745374
|
||||
0.000000
|
||||
"R_Leg_sjnt_0"
|
||||
1
|
||||
-0.940855 0.027320 -0.183670 -0.283391
|
||||
-0.104854 -0.000224 0.000080
|
||||
0.000000
|
||||
"R_Leg_sjnt_1"
|
||||
1
|
||||
0.732582 0.147108 -0.159629 0.645136
|
||||
0.000000 0.461808 0.000000
|
||||
0.000000
|
||||
"R_Foot_sjnt_0"
|
||||
1
|
||||
-0.543008 -0.043463 0.072346 0.835476
|
||||
0.000000 0.388174 0.000000
|
||||
0.000000
|
||||
"L_Leg_sjnt_0"
|
||||
1
|
||||
0.068071 -0.118484 0.183975 0.973386
|
||||
0.104854 -0.000225 0.000080
|
||||
0.000000
|
||||
"L_Leg_sjnt_1"
|
||||
1
|
||||
0.258573 0.111198 0.041401 0.958677
|
||||
0.000000 -0.461808 0.000000
|
||||
0.000000
|
||||
"L_Foot_sjnt_0"
|
||||
1
|
||||
-0.388386 -0.112771 -0.101140 0.908961
|
||||
-0.000001 -0.388173 -0.000000
|
||||
0.000000
|
||||
"C_Spine_sjnt_0"
|
||||
1
|
||||
0.055573 0.116937 0.111430 0.985302
|
||||
0.000000 0.055442 0.000000
|
||||
0.000000
|
||||
"C_Spine_sjnt_1"
|
||||
1
|
||||
0.037873 -0.006875 0.039870 0.998463
|
||||
0.000000 0.049000 0.000000
|
||||
0.000000
|
||||
"C_Spine_sjnt_2"
|
||||
1
|
||||
0.057513 -0.003345 0.060246 0.996520
|
||||
-0.000000 0.049000 -0.000000
|
||||
0.000000
|
||||
"C_Spine_sjnt_4"
|
||||
1
|
||||
0.058450 0.004523 0.059058 0.996532
|
||||
0.000000 0.098001 0.000000
|
||||
0.000000
|
||||
"L_Clavicle_sjnt_0"
|
||||
1
|
||||
-0.788890 0.552170 0.262911 0.060331
|
||||
0.007299 0.208857 0.030677
|
||||
0.000000
|
||||
"L_Arm_sjnt_0"
|
||||
1
|
||||
-0.242065 -0.166972 -0.682243 -0.669381
|
||||
0.070455 -0.150703 0.005819
|
||||
0.000000
|
||||
"L_Arm_sjnt_1"
|
||||
1
|
||||
0.293529 -0.405618 0.091549 0.860775
|
||||
-0.000001 -0.260631 0.000000
|
||||
0.000000
|
||||
"L_Wrist_sjnt_0"
|
||||
1
|
||||
-0.018010 -0.348798 0.050741 0.935650
|
||||
0.000007 -0.242273 0.000002
|
||||
0.000000
|
||||
"R_Clavicle_sjnt_0"
|
||||
1
|
||||
0.006775 0.017839 0.047960 0.998667
|
||||
-0.007299 0.208857 0.030677
|
||||
0.000000
|
||||
"R_Arm_sjnt_0"
|
||||
1
|
||||
-0.057684 0.616002 0.098229 0.779464
|
||||
-0.070458 0.150703 -0.005820
|
||||
0.000000
|
||||
"R_Arm_sjnt_1"
|
||||
1
|
||||
0.360633 -0.148932 -0.172766 0.904387
|
||||
-0.000001 0.260632 -0.000000
|
||||
0.000000
|
||||
"R_Wrist_sjnt_0"
|
||||
1
|
||||
-0.073581 -0.376053 0.364024 -0.848915
|
||||
0.000000 0.242268 -0.000000
|
||||
0.000000
|
||||
"C_Neck_sjnt_0"
|
||||
1
|
||||
0.208406 0.070974 -0.020180 0.975255
|
||||
-0.000000 0.206349 -0.038118
|
||||
0.000000
|
||||
"C_Neck_sjnt_1"
|
||||
1
|
||||
-0.214167 0.070851 -0.015228 0.974105
|
||||
-0.000000 0.054000 0.000000
|
||||
0.000000
|
||||
"C_Neck_sjnt_2"
|
||||
1
|
||||
0.013069 0.069734 0.004440 0.997470
|
||||
0.000000 0.054001 0.000000
|
||||
0.000000
|
||||
"C_Head_sjnt_0"
|
||||
1
|
||||
-0.011944 -0.296295 0.045126 0.953955
|
||||
0.000000 0.054000 0.000000
|
||||
0.000000
|
||||
+131
@@ -0,0 +1,131 @@
|
||||
TOS 1.00
|
||||
|
||||
declare SkeletalAnimation 1
|
||||
mAnimatedJoints array instance SkeletalAnimation::AnimatedJoint
|
||||
|
||||
declare SkeletalAnimation::AnimatedJoint 2
|
||||
mJointName string
|
||||
mKeyframes array instance SkeletalAnimation::Keyframe
|
||||
|
||||
declare SkeletalAnimation::Keyframe 3
|
||||
mRotation quat
|
||||
mTranslation vec3
|
||||
mTime float
|
||||
|
||||
object SkeletalAnimation 00000001
|
||||
23
|
||||
"hipsBone"
|
||||
1
|
||||
-0.006100 0.596243 0.801570 0.044078
|
||||
0.158819 0.119626 0.352148
|
||||
0.000000
|
||||
"R_Leg_sjnt_0"
|
||||
1
|
||||
0.987181 -0.088292 0.091403 0.096563
|
||||
-0.104854 -0.000224 0.000080
|
||||
0.000000
|
||||
"R_Leg_sjnt_1"
|
||||
1
|
||||
0.518738 0.091591 -0.028278 0.849542
|
||||
-0.000000 0.461809 -0.000000
|
||||
0.000000
|
||||
"R_Foot_sjnt_0"
|
||||
1
|
||||
-0.446222 -0.027605 0.081585 0.890768
|
||||
0.000000 0.388174 0.000000
|
||||
0.000000
|
||||
"L_Leg_sjnt_0"
|
||||
1
|
||||
-0.004252 0.099688 0.099358 0.990036
|
||||
0.104854 -0.000225 0.000080
|
||||
0.000000
|
||||
"L_Leg_sjnt_1"
|
||||
1
|
||||
0.332849 0.214890 0.078034 0.914847
|
||||
0.000000 -0.461808 0.000000
|
||||
0.000000
|
||||
"L_Foot_sjnt_0"
|
||||
1
|
||||
-0.353947 -0.242590 0.059009 0.901326
|
||||
-0.000001 -0.388173 -0.000000
|
||||
0.000000
|
||||
"C_Spine_sjnt_0"
|
||||
1
|
||||
0.040410 -0.000191 -0.035615 0.998548
|
||||
0.000000 0.055442 -0.000000
|
||||
0.000000
|
||||
"C_Spine_sjnt_1"
|
||||
1
|
||||
0.078135 -0.005104 -0.037889 0.996210
|
||||
0.000000 0.049000 0.000000
|
||||
0.000000
|
||||
"C_Spine_sjnt_2"
|
||||
1
|
||||
0.117588 0.001930 -0.056543 0.991450
|
||||
-0.000000 0.049000 0.000000
|
||||
0.000000
|
||||
"C_Spine_sjnt_4"
|
||||
1
|
||||
0.116613 0.022537 -0.060157 0.991098
|
||||
0.000000 0.098001 -0.000000
|
||||
0.000000
|
||||
"L_Clavicle_sjnt_0"
|
||||
1
|
||||
0.820798 -0.461866 -0.218872 0.255080
|
||||
0.007299 0.208857 0.030677
|
||||
0.000000
|
||||
"L_Arm_sjnt_0"
|
||||
1
|
||||
-0.018640 0.550280 0.313113 0.773825
|
||||
0.070455 -0.150703 0.005819
|
||||
0.000000
|
||||
"L_Arm_sjnt_1"
|
||||
1
|
||||
0.502820 -0.083351 -0.423467 0.748933
|
||||
-0.000001 -0.260631 0.000000
|
||||
0.000000
|
||||
"L_Wrist_sjnt_0"
|
||||
1
|
||||
-0.127266 -0.436122 0.115708 -0.883296
|
||||
0.000007 -0.242273 0.000002
|
||||
0.000000
|
||||
"R_Clavicle_sjnt_0"
|
||||
1
|
||||
-0.254409 -0.049344 0.561585 0.785789
|
||||
-0.007299 0.208857 0.030677
|
||||
0.000000
|
||||
"R_Arm_sjnt_0"
|
||||
1
|
||||
-0.297704 0.588370 -0.433881 -0.613954
|
||||
-0.070457 0.150703 -0.005820
|
||||
0.000000
|
||||
"R_Arm_sjnt_1"
|
||||
1
|
||||
0.300035 -0.109892 -0.134453 0.937990
|
||||
-0.000001 0.260632 -0.000000
|
||||
0.000000
|
||||
"R_Wrist_sjnt_0"
|
||||
1
|
||||
-0.074182 0.083861 -0.170265 0.979017
|
||||
0.000000 0.242268 -0.000000
|
||||
0.000000
|
||||
"C_Neck_sjnt_0"
|
||||
1
|
||||
0.095959 0.024101 0.021582 0.994859
|
||||
0.000000 0.206349 -0.038118
|
||||
0.000000
|
||||
"C_Neck_sjnt_1"
|
||||
1
|
||||
-0.330366 0.030108 0.013511 0.943276
|
||||
0.000000 0.054001 0.000000
|
||||
0.000000
|
||||
"C_Neck_sjnt_2"
|
||||
1
|
||||
-0.116595 0.020825 0.025026 0.992646
|
||||
0.000000 0.054001 0.000000
|
||||
0.000000
|
||||
"C_Head_sjnt_0"
|
||||
1
|
||||
-0.225003 0.005643 -0.043020 0.973392
|
||||
-0.000000 0.054000 0.000000
|
||||
0.000000
|
||||
+12514
File diff suppressed because it is too large
Load Diff
+131
@@ -0,0 +1,131 @@
|
||||
TOS 1.00
|
||||
|
||||
declare SkeletalAnimation 1
|
||||
mAnimatedJoints array instance SkeletalAnimation::AnimatedJoint
|
||||
|
||||
declare SkeletalAnimation::AnimatedJoint 2
|
||||
mJointName string
|
||||
mKeyframes array instance SkeletalAnimation::Keyframe
|
||||
|
||||
declare SkeletalAnimation::Keyframe 3
|
||||
mRotation quat
|
||||
mTranslation vec3
|
||||
mTime float
|
||||
|
||||
object SkeletalAnimation 00000001
|
||||
23
|
||||
"hipsBone"
|
||||
1
|
||||
0.000000 1.000000 0.000000 0.000000
|
||||
0.000000 0.931122 -0.023035
|
||||
0.000000
|
||||
"R_Leg_sjnt_0"
|
||||
1
|
||||
0.999643 -0.023767 -0.000290 0.012213
|
||||
-0.104854 -0.000224 0.000080
|
||||
0.000000
|
||||
"R_Leg_sjnt_1"
|
||||
1
|
||||
0.060151 0.000000 -0.000000 0.998189
|
||||
-0.000000 0.461809 -0.000000
|
||||
0.000000
|
||||
"R_Foot_sjnt_0"
|
||||
1
|
||||
-0.546992 0.011039 -0.021050 0.836800
|
||||
0.000000 0.388174 0.000000
|
||||
0.000000
|
||||
"L_Leg_sjnt_0"
|
||||
1
|
||||
-0.012213 -0.000290 0.023767 0.999643
|
||||
0.104854 -0.000225 0.000080
|
||||
0.000000
|
||||
"L_Leg_sjnt_1"
|
||||
1
|
||||
0.060151 0.000000 -0.000000 0.998189
|
||||
0.000000 -0.461807 0.000000
|
||||
0.000000
|
||||
"L_Foot_sjnt_0"
|
||||
1
|
||||
-0.546992 0.011039 -0.021050 0.836800
|
||||
-0.000001 -0.388173 -0.000000
|
||||
0.000000
|
||||
"C_Spine_sjnt_0"
|
||||
1
|
||||
0.000000 0.000000 0.000000 1.000000
|
||||
0.000000 0.055442 -0.000000
|
||||
0.000000
|
||||
"C_Spine_sjnt_1"
|
||||
1
|
||||
0.000000 0.000000 0.000000 1.000000
|
||||
0.000000 0.049000 0.000000
|
||||
0.000000
|
||||
"C_Spine_sjnt_2"
|
||||
1
|
||||
0.000000 0.000000 0.000000 1.000000
|
||||
0.000000 0.049000 -0.000000
|
||||
0.000000
|
||||
"C_Spine_sjnt_4"
|
||||
1
|
||||
0.000000 0.000000 0.000000 1.000000
|
||||
0.000000 0.098001 0.000000
|
||||
0.000000
|
||||
"L_Clavicle_sjnt_0"
|
||||
1
|
||||
0.761695 -0.617813 -0.144681 0.131128
|
||||
0.007299 0.208857 0.030677
|
||||
0.000000
|
||||
"L_Arm_sjnt_0"
|
||||
1
|
||||
0.199254 -0.056730 0.463827 0.861362
|
||||
0.070456 -0.150703 0.005820
|
||||
0.000000
|
||||
"L_Arm_sjnt_1"
|
||||
1
|
||||
0.184809 -0.000000 -0.000000 0.982774
|
||||
-0.000001 -0.260631 0.000000
|
||||
0.000000
|
||||
"L_Wrist_sjnt_0"
|
||||
1
|
||||
-0.000000 0.000000 0.000000 1.000000
|
||||
0.000007 -0.242273 0.000002
|
||||
0.000000
|
||||
"R_Clavicle_sjnt_0"
|
||||
1
|
||||
-0.131128 -0.144681 0.617813 0.761696
|
||||
-0.007299 0.208857 0.030677
|
||||
0.000000
|
||||
"R_Arm_sjnt_0"
|
||||
1
|
||||
0.199254 -0.056730 0.463827 0.861362
|
||||
-0.070458 0.150703 -0.005820
|
||||
0.000000
|
||||
"R_Arm_sjnt_1"
|
||||
1
|
||||
0.184809 0.000000 0.000000 0.982774
|
||||
-0.000001 0.260632 -0.000000
|
||||
0.000000
|
||||
"R_Wrist_sjnt_0"
|
||||
1
|
||||
-0.000000 0.000000 -0.000000 1.000000
|
||||
0.000000 0.242268 -0.000000
|
||||
0.000000
|
||||
"C_Neck_sjnt_0"
|
||||
1
|
||||
0.216440 0.000000 0.000000 0.976296
|
||||
0.000000 0.206349 -0.038118
|
||||
0.000000
|
||||
"C_Neck_sjnt_1"
|
||||
1
|
||||
-0.216440 0.000000 0.000000 0.976296
|
||||
0.000000 0.054001 0.000000
|
||||
0.000000
|
||||
"C_Neck_sjnt_2"
|
||||
1
|
||||
0.000000 0.000000 0.000000 1.000000
|
||||
0.000000 0.054001 0.000000
|
||||
0.000000
|
||||
"C_Head_sjnt_0"
|
||||
1
|
||||
0.000000 0.000000 0.000000 1.000000
|
||||
0.000000 0.054000 -0.000000
|
||||
0.000000
|
||||
+373
@@ -0,0 +1,373 @@
|
||||
TOS 1.00
|
||||
|
||||
declare SkeletalAnimation 2
|
||||
mAnimatedJoints array instance SkeletalAnimation::AnimatedJoint
|
||||
mIsLooping bool
|
||||
|
||||
declare SkeletalAnimation::AnimatedJoint 2
|
||||
mJointName string
|
||||
mKeyframes array instance SkeletalAnimation::Keyframe
|
||||
|
||||
declare SkeletalAnimation::Keyframe 3
|
||||
mRotation quat
|
||||
mTranslation vec3
|
||||
mTime float
|
||||
|
||||
object SkeletalAnimation 00000001
|
||||
71
|
||||
"rootBone"
|
||||
1
|
||||
-0.707106829 0 0 0.707106769
|
||||
0 0 0
|
||||
0
|
||||
"C_Neck_sjnt_2"
|
||||
1
|
||||
0 0 0 1
|
||||
6.31036857e-18 0.0540000014 0
|
||||
0
|
||||
"R_Clavicle_sjnt_0"
|
||||
1
|
||||
-0.131128147 -0.144681439 0.617813051 0.761695385
|
||||
-0.00729848538 0.20885624 0.0306759924
|
||||
0
|
||||
"R_Leg_sjnt_0"
|
||||
1
|
||||
0.999642909 -0.0237673745 -0.000290388998 0.0122136045
|
||||
-0.104853801 -0.000224408359 7.95794331e-05
|
||||
0
|
||||
"C_Spine_sjnt_4"
|
||||
1
|
||||
0 0 0 1
|
||||
4.77984621e-18 0.0489999987 3.10862448e-17
|
||||
0
|
||||
"L_Middle_sjnt_3"
|
||||
1
|
||||
0 0 0 1
|
||||
5.85307589e-07 -0.0180757623 3.17060227e-07
|
||||
0
|
||||
"C_Neck_sjnt_0"
|
||||
1
|
||||
0.21643962 0 0 0.976296008
|
||||
-6.33361028e-18 0.206347629 -0.0381180719
|
||||
0
|
||||
"C_Head_sjnt_0"
|
||||
1
|
||||
0 0 0 1
|
||||
6.31036857e-18 0.0540000014 2.8532731e-16
|
||||
0
|
||||
"C_Spine_sjnt_1"
|
||||
1
|
||||
0 0 0 1
|
||||
4.77984621e-18 0.0489999987 0
|
||||
0
|
||||
"L_Ring_sjnt_0"
|
||||
1
|
||||
0.119370371 -0.698211312 0.204397932 0.675628006
|
||||
-0.006254646 -0.0797718689 0.0093988115
|
||||
0
|
||||
"R_Index_sjnt_2"
|
||||
1
|
||||
0.175203487 0 0 0.984532237
|
||||
3.01980666e-16 0.0204999987 0
|
||||
0
|
||||
"R_Ring_sjnt_0"
|
||||
1
|
||||
0.119370371 -0.698211312 0.204397932 0.675628006
|
||||
0.00625085598 0.0797746703 -0.00940056238
|
||||
0
|
||||
"R_Index_sjnt_0"
|
||||
1
|
||||
-0.19517909 0.755869865 -0.161748767 -0.603658199
|
||||
-0.00134941039 0.0782186612 0.028039448
|
||||
0
|
||||
"R_Pinky_sjnt_1"
|
||||
1
|
||||
0.22303848 0 0 0.974809647
|
||||
-3.55271347e-16 0.0372027382 0
|
||||
0
|
||||
"L_Pinky_sjnt_1"
|
||||
1
|
||||
0.22303848 0 0 0.974809647
|
||||
3.70620683e-07 -0.0372028351 1.38079258e-07
|
||||
0
|
||||
"R_Middle_sjnt_0"
|
||||
1
|
||||
0.156041026 -0.732423544 0.191366434 0.63449657
|
||||
0.00616463134 0.0818372741 0.0097120041
|
||||
0
|
||||
"R_Arm_sjnt_1"
|
||||
1
|
||||
0.184809059 0 0 0.982774496
|
||||
-1.42108544e-16 0.260629684 4.440892e-18
|
||||
0
|
||||
"L_Foot_sjnt_2"
|
||||
1
|
||||
0 0 0 1
|
||||
-1.7763568e-17 -0.0488719977 4.88498128e-17
|
||||
0
|
||||
"L_Pinky_sjnt_2"
|
||||
1
|
||||
0.0992502794 0 0 0.99506253
|
||||
-1.85520605e-07 -0.0186209753 6.46735657e-07
|
||||
0
|
||||
"L_Ring_sjnt_3"
|
||||
1
|
||||
0 0 0 1
|
||||
4.95807114e-07 -0.0159507934 1.36332858e-07
|
||||
0
|
||||
"L_Clavicle_sjnt_0"
|
||||
1
|
||||
0.761695385 -0.617813051 -0.144681439 0.131128147
|
||||
0.00729848957 0.208856419 0.0306760129
|
||||
0
|
||||
"L_Pinky_sjnt_3"
|
||||
1
|
||||
0 0 0 1
|
||||
3.66131957e-07 -0.0121525498 -7.50564652e-07
|
||||
0
|
||||
"R_Thumb_sjnt_3"
|
||||
1
|
||||
0 0 0 1
|
||||
7.1054272e-17 0.0181292463 -2.62012622e-16
|
||||
0
|
||||
"R_Foot_sjnt_2"
|
||||
1
|
||||
0 0 0 1
|
||||
3.5527136e-17 0.0488717034 -3.99680272e-17
|
||||
0
|
||||
"L_Leg_sjnt_0"
|
||||
1
|
||||
-0.0122135505 -0.000290387718 0.0237673745 0.999642909
|
||||
0.104854003 -0.000224642019 7.96136592e-05
|
||||
0
|
||||
"L_Middle_sjnt_1"
|
||||
1
|
||||
0.184680417 0 0 0.982798636
|
||||
-2.44896114e-07 -0.0481087901 -7.74885621e-07
|
||||
0
|
||||
"L_Pinky_sjnt_0"
|
||||
1
|
||||
0.105012663 -0.656231523 0.23035267 0.710823596
|
||||
-0.00242854073 -0.0733879432 0.0260373093
|
||||
0
|
||||
"L_Wrist_sjnt_0"
|
||||
1
|
||||
0 0 0 1
|
||||
6.57227065e-06 -0.242271721 2.52947029e-06
|
||||
0
|
||||
"R_Ring_sjnt_1"
|
||||
1
|
||||
0.251216322 0 0 0.967930973
|
||||
-5.3290704e-17 0.0443951264 -5.68434176e-16
|
||||
0
|
||||
"R_Pinky_sjnt_2"
|
||||
1
|
||||
0.0992502794 0 0 0.99506253
|
||||
-1.06581408e-16 0.0186204202 -7.1054272e-17
|
||||
0
|
||||
"L_Prop_fjnt_0"
|
||||
1
|
||||
0 1 0 -4.37113883e-08
|
||||
0.0276746862 -0.0656316727 -0.000328583526
|
||||
0
|
||||
"L_Middle_sjnt_2"
|
||||
1
|
||||
0.157416984 0 0 0.987532258
|
||||
-6.02384603e-07 -0.0248495787 6.76881555e-08
|
||||
0
|
||||
"R_Middle_sjnt_1"
|
||||
1
|
||||
0.184680417 0 0 0.982798636
|
||||
-6.39488435e-16 0.048108764 1.42108544e-16
|
||||
0
|
||||
"L_Leg_sjnt_1"
|
||||
1
|
||||
0.060151346 0 0 0.99818927
|
||||
2.61005539e-07 -0.461806506 -3.93129014e-08
|
||||
0
|
||||
"L_Thumb_sjnt_2"
|
||||
1
|
||||
-0.0012165627 0 0 0.999999285
|
||||
5.15941792e-07 -0.0251661409 -5.85450152e-07
|
||||
0
|
||||
"L_Ring_sjnt_1"
|
||||
1
|
||||
0.251216322 0 0 0.967930973
|
||||
3.12667623e-07 -0.0443952158 -5.95922245e-07
|
||||
0
|
||||
"R_Foot_sjnt_1"
|
||||
1
|
||||
-0.251680881 0 0 0.967810273
|
||||
-8.88178367e-17 0.133286357 -0.00287180441
|
||||
0
|
||||
"C_Neck_sjnt_1"
|
||||
1
|
||||
-0.21643962 0 0 0.976296008
|
||||
5.18627479e-18 0.0540000014 0
|
||||
0
|
||||
"R_Ring_sjnt_3"
|
||||
1
|
||||
0 0 0 1
|
||||
-5.3290704e-17 0.0159499999 -7.1054272e-17
|
||||
0
|
||||
"L_Index_sjnt_0"
|
||||
1
|
||||
-0.19517909 0.755869865 -0.161748767 -0.603658199
|
||||
0.00134612026 -0.0782155693 -0.0280411374
|
||||
0
|
||||
"L_Index_sjnt_1"
|
||||
1
|
||||
0.229845911 0 0 0.973227024
|
||||
7.62208856e-07 -0.041899953 -1.70619145e-07
|
||||
0
|
||||
"R_Thumb_sjnt_1"
|
||||
1
|
||||
0.0813905671 0 0 0.996682286
|
||||
-2.13162816e-16 0.0301780477 1.42108544e-16
|
||||
0
|
||||
"L_Thumb_sjnt_3"
|
||||
1
|
||||
0 0 0 1
|
||||
-7.5862016e-07 -0.0181290414 5.47535365e-07
|
||||
0
|
||||
"R_Index_sjnt_3"
|
||||
1
|
||||
0 0 0 1
|
||||
3.10862442e-16 0.019439999 5.3290704e-17
|
||||
0
|
||||
"R_Middle_sjnt_2"
|
||||
1
|
||||
0.157416984 0 0 0.987532258
|
||||
-1.7763568e-17 0.0248499978 7.1054272e-17
|
||||
0
|
||||
"hipsBone"
|
||||
1
|
||||
3.09086232e-08 0.707106829 0.707106829 3.09086232e-08
|
||||
0 0.0230353847 0.931121647
|
||||
0
|
||||
"R_Pinky_sjnt_3"
|
||||
1
|
||||
0 0 0 1
|
||||
7.1054272e-17 0.0121525582 3.5527136e-17
|
||||
0
|
||||
"L_Foot_sjnt_0"
|
||||
1
|
||||
-0.546992362 0.0110395309 -0.0210499652 0.836800098
|
||||
-9.25209633e-07 -0.388170779 2.78088415e-08
|
||||
0
|
||||
"L_Index_sjnt_2"
|
||||
1
|
||||
0.175203487 0 0 0.984532237
|
||||
8.53871498e-08 -0.0204997063 3.77475885e-07
|
||||
0
|
||||
"C_Spine_sjnt_3"
|
||||
1
|
||||
0 0 0 1
|
||||
4.77984621e-18 0.0489999987 1.7763568e-17
|
||||
0
|
||||
"R_Foot_sjnt_0"
|
||||
1
|
||||
-0.546992362 0.0110395309 -0.0210499652 0.836800098
|
||||
0 0.38817063 0
|
||||
0
|
||||
"R_Ring_sjnt_2"
|
||||
1
|
||||
0.121089756 0 0 0.992641568
|
||||
-5.3290704e-17 0.0234420039 1.42108544e-16
|
||||
0
|
||||
"R_Wrist_sjnt_0"
|
||||
1
|
||||
0 0 0 1
|
||||
4.26325632e-16 0.24226594 -3.90798503e-16
|
||||
0
|
||||
"L_Middle_sjnt_0"
|
||||
1
|
||||
0.156041026 -0.732423544 0.191366434 0.63449657
|
||||
-0.00616830075 -0.0818345174 -0.0097129494
|
||||
0
|
||||
"L_Ring_sjnt_2"
|
||||
1
|
||||
0.121089756 0 0 0.992641568
|
||||
1.66412786e-08 -0.0234416053 4.04103446e-07
|
||||
0
|
||||
"L_Index_sjnt_3"
|
||||
1
|
||||
0 0 0 1
|
||||
-2.39056641e-09 -0.0194404367 -1.39765135e-07
|
||||
0
|
||||
"C_Spine_sjnt_0"
|
||||
1
|
||||
0 0 0 1
|
||||
3.76215184e-18 0.0554419272 8.881784e-18
|
||||
0
|
||||
"L_Arm_sjnt_1"
|
||||
1
|
||||
0.184809059 0 0 0.982774496
|
||||
-1.14686986e-06 -0.260628074 -4.16461354e-08
|
||||
0
|
||||
"R_Leg_sjnt_1"
|
||||
1
|
||||
0.060151346 0 0 0.99818927
|
||||
3.5527136e-17 0.461806893 8.881784e-18
|
||||
0
|
||||
"R_Thumb_sjnt_2"
|
||||
1
|
||||
-0.0012165627 0 0 0.999999285
|
||||
4.26325632e-16 0.0251665488 5.10702581e-16
|
||||
0
|
||||
"L_Foot_sjnt_1"
|
||||
1
|
||||
-0.251680881 0 0 0.967810273
|
||||
5.3290704e-17 -0.133285969 0.00287160906
|
||||
0
|
||||
"R_Pinky_sjnt_0"
|
||||
1
|
||||
0.105012663 -0.656231523 0.23035267 0.710823596
|
||||
0.00242519076 0.0733913928 -0.0260387883
|
||||
0
|
||||
"R_Middle_sjnt_3"
|
||||
1
|
||||
0 0 0 1
|
||||
2.48689959e-16 0.0180759132 -7.1054272e-17
|
||||
0
|
||||
"L_Thumb_sjnt_1"
|
||||
1
|
||||
0.0813905671 0 0 0.996682286
|
||||
-5.24074721e-07 -0.0301787555 -2.92531354e-07
|
||||
0
|
||||
"C_Spine_sjnt_2"
|
||||
1
|
||||
0 0 0 1
|
||||
4.7798458e-18 0.0489999987 -2.22044592e-17
|
||||
0
|
||||
"R_Prop_fjnt_0"
|
||||
1
|
||||
0 0 0 1
|
||||
-0.0276775807 0.0656346902 0.000327039947
|
||||
0
|
||||
"L_Thumb_sjnt_0"
|
||||
1
|
||||
0.416852266 -0.817598581 -0.284677148 -0.27699402
|
||||
0.020829184 -0.0239574499 -0.0221176092
|
||||
0
|
||||
"R_Thumb_sjnt_0"
|
||||
1
|
||||
0.416852266 -0.817598581 -0.284677148 -0.27699402
|
||||
-0.0208326261 0.0239606146 0.0221159924
|
||||
0
|
||||
"L_Arm_sjnt_0"
|
||||
1
|
||||
0.199253842 -0.0567296185 0.463827372 0.861361623
|
||||
0.0704552606 -0.150702849 0.00581921311
|
||||
0
|
||||
"R_Arm_sjnt_0"
|
||||
1
|
||||
0.199253842 -0.0567296185 0.463827372 0.861361623
|
||||
-0.0704575405 0.150702029 -0.00581940683
|
||||
0
|
||||
"R_Index_sjnt_1"
|
||||
1
|
||||
0.229845911 0 0 0.973227024
|
||||
-5.3290704e-17 0.0419000015 1.42108544e-16
|
||||
0
|
||||
true
|
||||
+153
@@ -0,0 +1,153 @@
|
||||
TOS 1.00
|
||||
|
||||
declare Skeleton 1
|
||||
mJoints array instance Skeleton::Joint
|
||||
|
||||
declare Skeleton::Joint 2
|
||||
mName string
|
||||
mParentName string
|
||||
|
||||
object Skeleton 00000001
|
||||
71
|
||||
"rootBone"
|
||||
""
|
||||
"hipsBone"
|
||||
"rootBone"
|
||||
"C_Spine_sjnt_0"
|
||||
"hipsBone"
|
||||
"C_Spine_sjnt_1"
|
||||
"C_Spine_sjnt_0"
|
||||
"C_Spine_sjnt_2"
|
||||
"C_Spine_sjnt_1"
|
||||
"C_Spine_sjnt_3"
|
||||
"C_Spine_sjnt_2"
|
||||
"C_Spine_sjnt_4"
|
||||
"C_Spine_sjnt_3"
|
||||
"R_Clavicle_sjnt_0"
|
||||
"C_Spine_sjnt_4"
|
||||
"R_Arm_sjnt_0"
|
||||
"R_Clavicle_sjnt_0"
|
||||
"R_Arm_sjnt_1"
|
||||
"R_Arm_sjnt_0"
|
||||
"R_Wrist_sjnt_0"
|
||||
"R_Arm_sjnt_1"
|
||||
"R_Thumb_sjnt_0"
|
||||
"R_Wrist_sjnt_0"
|
||||
"R_Thumb_sjnt_1"
|
||||
"R_Thumb_sjnt_0"
|
||||
"R_Thumb_sjnt_2"
|
||||
"R_Thumb_sjnt_1"
|
||||
"R_Thumb_sjnt_3"
|
||||
"R_Thumb_sjnt_2"
|
||||
"R_Index_sjnt_0"
|
||||
"R_Wrist_sjnt_0"
|
||||
"R_Index_sjnt_1"
|
||||
"R_Index_sjnt_0"
|
||||
"R_Index_sjnt_2"
|
||||
"R_Index_sjnt_1"
|
||||
"R_Index_sjnt_3"
|
||||
"R_Index_sjnt_2"
|
||||
"R_Middle_sjnt_0"
|
||||
"R_Wrist_sjnt_0"
|
||||
"R_Middle_sjnt_1"
|
||||
"R_Middle_sjnt_0"
|
||||
"R_Middle_sjnt_2"
|
||||
"R_Middle_sjnt_1"
|
||||
"R_Middle_sjnt_3"
|
||||
"R_Middle_sjnt_2"
|
||||
"R_Ring_sjnt_0"
|
||||
"R_Wrist_sjnt_0"
|
||||
"R_Ring_sjnt_1"
|
||||
"R_Ring_sjnt_0"
|
||||
"R_Ring_sjnt_2"
|
||||
"R_Ring_sjnt_1"
|
||||
"R_Ring_sjnt_3"
|
||||
"R_Ring_sjnt_2"
|
||||
"R_Pinky_sjnt_0"
|
||||
"R_Wrist_sjnt_0"
|
||||
"R_Pinky_sjnt_1"
|
||||
"R_Pinky_sjnt_0"
|
||||
"R_Pinky_sjnt_2"
|
||||
"R_Pinky_sjnt_1"
|
||||
"R_Pinky_sjnt_3"
|
||||
"R_Pinky_sjnt_2"
|
||||
"R_Prop_fjnt_0"
|
||||
"R_Wrist_sjnt_0"
|
||||
"C_Neck_sjnt_0"
|
||||
"C_Spine_sjnt_4"
|
||||
"C_Neck_sjnt_1"
|
||||
"C_Neck_sjnt_0"
|
||||
"C_Neck_sjnt_2"
|
||||
"C_Neck_sjnt_1"
|
||||
"C_Head_sjnt_0"
|
||||
"C_Neck_sjnt_2"
|
||||
"L_Clavicle_sjnt_0"
|
||||
"C_Spine_sjnt_4"
|
||||
"L_Arm_sjnt_0"
|
||||
"L_Clavicle_sjnt_0"
|
||||
"L_Arm_sjnt_1"
|
||||
"L_Arm_sjnt_0"
|
||||
"L_Wrist_sjnt_0"
|
||||
"L_Arm_sjnt_1"
|
||||
"L_Thumb_sjnt_0"
|
||||
"L_Wrist_sjnt_0"
|
||||
"L_Thumb_sjnt_1"
|
||||
"L_Thumb_sjnt_0"
|
||||
"L_Thumb_sjnt_2"
|
||||
"L_Thumb_sjnt_1"
|
||||
"L_Thumb_sjnt_3"
|
||||
"L_Thumb_sjnt_2"
|
||||
"L_Index_sjnt_0"
|
||||
"L_Wrist_sjnt_0"
|
||||
"L_Index_sjnt_1"
|
||||
"L_Index_sjnt_0"
|
||||
"L_Index_sjnt_2"
|
||||
"L_Index_sjnt_1"
|
||||
"L_Index_sjnt_3"
|
||||
"L_Index_sjnt_2"
|
||||
"L_Middle_sjnt_0"
|
||||
"L_Wrist_sjnt_0"
|
||||
"L_Middle_sjnt_1"
|
||||
"L_Middle_sjnt_0"
|
||||
"L_Middle_sjnt_2"
|
||||
"L_Middle_sjnt_1"
|
||||
"L_Middle_sjnt_3"
|
||||
"L_Middle_sjnt_2"
|
||||
"L_Ring_sjnt_0"
|
||||
"L_Wrist_sjnt_0"
|
||||
"L_Ring_sjnt_1"
|
||||
"L_Ring_sjnt_0"
|
||||
"L_Ring_sjnt_2"
|
||||
"L_Ring_sjnt_1"
|
||||
"L_Ring_sjnt_3"
|
||||
"L_Ring_sjnt_2"
|
||||
"L_Pinky_sjnt_0"
|
||||
"L_Wrist_sjnt_0"
|
||||
"L_Pinky_sjnt_1"
|
||||
"L_Pinky_sjnt_0"
|
||||
"L_Pinky_sjnt_2"
|
||||
"L_Pinky_sjnt_1"
|
||||
"L_Pinky_sjnt_3"
|
||||
"L_Pinky_sjnt_2"
|
||||
"L_Prop_fjnt_0"
|
||||
"L_Wrist_sjnt_0"
|
||||
"R_Leg_sjnt_0"
|
||||
"hipsBone"
|
||||
"R_Leg_sjnt_1"
|
||||
"R_Leg_sjnt_0"
|
||||
"R_Foot_sjnt_0"
|
||||
"R_Leg_sjnt_1"
|
||||
"R_Foot_sjnt_1"
|
||||
"R_Foot_sjnt_0"
|
||||
"R_Foot_sjnt_2"
|
||||
"R_Foot_sjnt_1"
|
||||
"L_Leg_sjnt_0"
|
||||
"hipsBone"
|
||||
"L_Leg_sjnt_1"
|
||||
"L_Leg_sjnt_0"
|
||||
"L_Foot_sjnt_0"
|
||||
"L_Leg_sjnt_1"
|
||||
"L_Foot_sjnt_1"
|
||||
"L_Foot_sjnt_0"
|
||||
"L_Foot_sjnt_2"
|
||||
"L_Foot_sjnt_1"
|
||||
+3443
File diff suppressed because it is too large
Load Diff
+5927
File diff suppressed because it is too large
Load Diff
Vendored
+8
@@ -0,0 +1,8 @@
|
||||
The following assets were taken from Horizon Zero Dawn:
|
||||
|
||||
terrain1.bof and terrain2.bof contain the 'Mothers Heart' scene
|
||||
convex_hulls.bin contains point clouds used as the source for convex hulls
|
||||
heightfield1.bin contains a single 'tile' of terrain data
|
||||
Human.tof and Human/*.tof contain the Aloy ragdoll setup and a couple of sample animations mapped onto the ragdoll
|
||||
|
||||
Permission was granted by Guerrilla Games to release this under the same MIT license as the rest of the project.
|
||||
+165
@@ -0,0 +1,165 @@
|
||||
GNU LESSER GENERAL PUBLIC LICENSE
|
||||
Version 3, 29 June 2007
|
||||
|
||||
Copyright (C) 2007 Free Software Foundation, Inc. <https://fsf.org/>
|
||||
Everyone is permitted to copy and distribute verbatim copies
|
||||
of this license document, but changing it is not allowed.
|
||||
|
||||
|
||||
This version of the GNU Lesser General Public License incorporates
|
||||
the terms and conditions of version 3 of the GNU General Public
|
||||
License, supplemented by the additional permissions listed below.
|
||||
|
||||
0. Additional Definitions.
|
||||
|
||||
As used herein, "this License" refers to version 3 of the GNU Lesser
|
||||
General Public License, and the "GNU GPL" refers to version 3 of the GNU
|
||||
General Public License.
|
||||
|
||||
"The Library" refers to a covered work governed by this License,
|
||||
other than an Application or a Combined Work as defined below.
|
||||
|
||||
An "Application" is any work that makes use of an interface provided
|
||||
by the Library, but which is not otherwise based on the Library.
|
||||
Defining a subclass of a class defined by the Library is deemed a mode
|
||||
of using an interface provided by the Library.
|
||||
|
||||
A "Combined Work" is a work produced by combining or linking an
|
||||
Application with the Library. The particular version of the Library
|
||||
with which the Combined Work was made is also called the "Linked
|
||||
Version".
|
||||
|
||||
The "Minimal Corresponding Source" for a Combined Work means the
|
||||
Corresponding Source for the Combined Work, excluding any source code
|
||||
for portions of the Combined Work that, considered in isolation, are
|
||||
based on the Application, and not on the Linked Version.
|
||||
|
||||
The "Corresponding Application Code" for a Combined Work means the
|
||||
object code and/or source code for the Application, including any data
|
||||
and utility programs needed for reproducing the Combined Work from the
|
||||
Application, but excluding the System Libraries of the Combined Work.
|
||||
|
||||
1. Exception to Section 3 of the GNU GPL.
|
||||
|
||||
You may convey a covered work under sections 3 and 4 of this License
|
||||
without being bound by section 3 of the GNU GPL.
|
||||
|
||||
2. Conveying Modified Versions.
|
||||
|
||||
If you modify a copy of the Library, and, in your modifications, a
|
||||
facility refers to a function or data to be supplied by an Application
|
||||
that uses the facility (other than as an argument passed when the
|
||||
facility is invoked), then you may convey a copy of the modified
|
||||
version:
|
||||
|
||||
a) under this License, provided that you make a good faith effort to
|
||||
ensure that, in the event an Application does not supply the
|
||||
function or data, the facility still operates, and performs
|
||||
whatever part of its purpose remains meaningful, or
|
||||
|
||||
b) under the GNU GPL, with none of the additional permissions of
|
||||
this License applicable to that copy.
|
||||
|
||||
3. Object Code Incorporating Material from Library Header Files.
|
||||
|
||||
The object code form of an Application may incorporate material from
|
||||
a header file that is part of the Library. You may convey such object
|
||||
code under terms of your choice, provided that, if the incorporated
|
||||
material is not limited to numerical parameters, data structure
|
||||
layouts and accessors, or small macros, inline functions and templates
|
||||
(ten or fewer lines in length), you do both of the following:
|
||||
|
||||
a) Give prominent notice with each copy of the object code that the
|
||||
Library is used in it and that the Library and its use are
|
||||
covered by this License.
|
||||
|
||||
b) Accompany the object code with a copy of the GNU GPL and this license
|
||||
document.
|
||||
|
||||
4. Combined Works.
|
||||
|
||||
You may convey a Combined Work under terms of your choice that,
|
||||
taken together, effectively do not restrict modification of the
|
||||
portions of the Library contained in the Combined Work and reverse
|
||||
engineering for debugging such modifications, if you also do each of
|
||||
the following:
|
||||
|
||||
a) Give prominent notice with each copy of the Combined Work that
|
||||
the Library is used in it and that the Library and its use are
|
||||
covered by this License.
|
||||
|
||||
b) Accompany the Combined Work with a copy of the GNU GPL and this license
|
||||
document.
|
||||
|
||||
c) For a Combined Work that displays copyright notices during
|
||||
execution, include the copyright notice for the Library among
|
||||
these notices, as well as a reference directing the user to the
|
||||
copies of the GNU GPL and this license document.
|
||||
|
||||
d) Do one of the following:
|
||||
|
||||
0) Convey the Minimal Corresponding Source under the terms of this
|
||||
License, and the Corresponding Application Code in a form
|
||||
suitable for, and under terms that permit, the user to
|
||||
recombine or relink the Application with a modified version of
|
||||
the Linked Version to produce a modified Combined Work, in the
|
||||
manner specified by section 6 of the GNU GPL for conveying
|
||||
Corresponding Source.
|
||||
|
||||
1) Use a suitable shared library mechanism for linking with the
|
||||
Library. A suitable mechanism is one that (a) uses at run time
|
||||
a copy of the Library already present on the user's computer
|
||||
system, and (b) will operate properly with a modified version
|
||||
of the Library that is interface-compatible with the Linked
|
||||
Version.
|
||||
|
||||
e) Provide Installation Information, but only if you would otherwise
|
||||
be required to provide such information under section 6 of the
|
||||
GNU GPL, and only to the extent that such information is
|
||||
necessary to install and execute a modified version of the
|
||||
Combined Work produced by recombining or relinking the
|
||||
Application with a modified version of the Linked Version. (If
|
||||
you use option 4d0, the Installation Information must accompany
|
||||
the Minimal Corresponding Source and Corresponding Application
|
||||
Code. If you use option 4d1, you must provide the Installation
|
||||
Information in the manner specified by section 6 of the GNU GPL
|
||||
for conveying Corresponding Source.)
|
||||
|
||||
5. Combined Libraries.
|
||||
|
||||
You may place library facilities that are a work based on the
|
||||
Library side by side in a single library together with other library
|
||||
facilities that are not Applications and are not covered by this
|
||||
License, and convey such a combined library under terms of your
|
||||
choice, if you do both of the following:
|
||||
|
||||
a) Accompany the combined library with a copy of the same work based
|
||||
on the Library, uncombined with any other library facilities,
|
||||
conveyed under the terms of this License.
|
||||
|
||||
b) Give prominent notice with the combined library that part of it
|
||||
is a work based on the Library, and explaining where to find the
|
||||
accompanying uncombined form of the same work.
|
||||
|
||||
6. Revised Versions of the GNU Lesser General Public License.
|
||||
|
||||
The Free Software Foundation may publish revised and/or new versions
|
||||
of the GNU Lesser General Public License from time to time. Such new
|
||||
versions will be similar in spirit to the present version, but may
|
||||
differ in detail to address new problems or concerns.
|
||||
|
||||
Each version is given a distinguishing version number. If the
|
||||
Library as you received it specifies that a certain numbered version
|
||||
of the GNU Lesser General Public License "or any later version"
|
||||
applies to it, you have the option of following the terms and
|
||||
conditions either of that published version or of any later version
|
||||
published by the Free Software Foundation. If the Library as you
|
||||
received it does not specify a version number of the GNU Lesser
|
||||
General Public License, you may choose any version of the GNU Lesser
|
||||
General Public License ever published by the Free Software Foundation.
|
||||
|
||||
If the Library as you received it specifies that a proxy can decide
|
||||
whether future versions of the GNU Lesser General Public License shall
|
||||
apply, that proxy's public statement of acceptance of any version is
|
||||
permanent authorization for you to choose that version for the
|
||||
Library.
|
||||
@@ -0,0 +1,3 @@
|
||||
Race tracks taken from: https://github.com/TUMFTM/racetrack-database
|
||||
|
||||
See LICENSE.txt for license for these race tracks.
|
||||
+865
@@ -0,0 +1,865 @@
|
||||
# x_m,y_m,w_tr_right_m,w_tr_left_m
|
||||
-1.683339,-1.878198,5.074,5.271
|
||||
0.151452,2.772507,5.099,5.295
|
||||
1.986397,7.423128,5.125,5.319
|
||||
3.821455,12.073677,5.150,5.343
|
||||
5.656587,16.724166,5.175,5.367
|
||||
7.491752,21.374607,5.200,5.391
|
||||
9.326909,26.025014,5.226,5.415
|
||||
11.162019,30.675397,5.251,5.439
|
||||
12.997042,35.325770,5.276,5.462
|
||||
14.831936,39.976144,5.301,5.486
|
||||
16.666662,44.626532,5.327,5.510
|
||||
18.501180,49.276946,5.352,5.534
|
||||
20.335449,53.927398,5.377,5.558
|
||||
22.169429,58.577901,5.402,5.582
|
||||
24.003080,63.228467,5.428,5.606
|
||||
25.836362,67.879107,5.453,5.630
|
||||
27.669244,72.529833,5.478,5.654
|
||||
29.501738,77.180644,5.503,5.678
|
||||
31.333865,81.831537,5.529,5.702
|
||||
33.165645,86.482511,5.554,5.726
|
||||
34.997100,91.133563,5.579,5.750
|
||||
36.828251,95.784691,5.604,5.774
|
||||
38.659117,100.435894,5.630,5.798
|
||||
40.489721,105.087167,5.655,5.822
|
||||
42.320083,109.738510,5.680,5.845
|
||||
44.150224,114.389921,5.706,5.869
|
||||
45.980165,119.041396,5.731,5.893
|
||||
47.809927,123.692934,5.756,5.917
|
||||
49.639531,128.344532,5.781,5.941
|
||||
51.468997,132.996189,5.807,5.965
|
||||
53.298346,137.647901,5.832,5.989
|
||||
55.127600,142.299668,5.857,6.013
|
||||
56.956780,146.951486,5.882,6.037
|
||||
58.785905,151.603353,5.908,6.061
|
||||
60.614998,156.255268,5.933,6.085
|
||||
62.444078,160.907227,5.958,6.109
|
||||
64.273168,165.559229,5.983,6.133
|
||||
66.102287,170.211271,6.009,6.157
|
||||
67.931458,174.863352,6.034,6.181
|
||||
69.760699,179.515468,6.059,6.205
|
||||
71.590034,184.167619,6.084,6.229
|
||||
73.419481,188.819800,6.110,6.252
|
||||
75.249063,193.472011,6.135,6.276
|
||||
77.078801,198.124249,6.160,6.300
|
||||
78.908714,202.776512,6.185,6.324
|
||||
80.738825,207.428798,6.211,6.348
|
||||
82.569153,212.081104,6.236,6.372
|
||||
84.399720,216.733428,6.261,6.396
|
||||
86.230547,221.385768,6.286,6.420
|
||||
88.061655,226.038121,6.312,6.444
|
||||
89.893064,230.690486,6.337,6.468
|
||||
91.724795,235.342861,6.362,6.492
|
||||
93.556870,239.995242,6.388,6.516
|
||||
95.389309,244.647628,6.413,6.540
|
||||
97.222133,249.300016,6.438,6.564
|
||||
99.055363,253.952405,6.463,6.588
|
||||
100.889021,258.604792,6.489,6.612
|
||||
102.723126,263.257175,6.514,6.635
|
||||
104.557699,267.909552,6.539,6.659
|
||||
106.392763,272.561920,6.564,6.683
|
||||
108.228337,277.214277,6.590,6.707
|
||||
110.064442,281.866621,6.615,6.731
|
||||
111.901100,286.518949,6.640,6.755
|
||||
113.738331,291.171261,6.665,6.779
|
||||
115.576156,295.823552,6.691,6.803
|
||||
117.414596,300.475821,6.716,6.827
|
||||
119.253672,305.128067,6.741,6.851
|
||||
121.093405,309.780286,6.766,6.875
|
||||
122.933816,314.432476,6.792,6.899
|
||||
124.774925,319.084635,6.816,6.923
|
||||
126.651699,323.714334,6.669,7.006
|
||||
128.738887,328.209430,6.522,7.089
|
||||
131.246183,332.435357,6.522,6.226
|
||||
134.379060,336.257639,6.092,6.062
|
||||
138.182494,339.545392,5.677,6.289
|
||||
142.495039,342.172347,5.848,6.230
|
||||
147.141834,344.013044,6.038,6.065
|
||||
151.981474,345.037089,5.885,6.029
|
||||
156.945280,345.420747,6.132,5.821
|
||||
161.974127,345.367418,6.058,5.924
|
||||
167.008204,345.065211,5.807,6.178
|
||||
171.977944,344.482774,5.789,6.230
|
||||
176.806475,343.424482,5.869,6.193
|
||||
181.417183,341.694720,5.987,6.121
|
||||
185.749365,339.242190,5.914,6.218
|
||||
189.762356,336.197440,5.948,6.207
|
||||
193.416775,332.702620,6.070,6.105
|
||||
196.666967,328.885936,6.207,5.965
|
||||
199.423062,324.777280,5.742,6.233
|
||||
201.576184,320.364273,5.591,6.084
|
||||
203.023502,315.640256,5.646,5.825
|
||||
203.748491,310.681493,5.785,5.710
|
||||
203.798453,305.625580,5.801,5.643
|
||||
203.222189,300.611552,5.651,5.577
|
||||
202.092240,295.744077,5.363,5.608
|
||||
200.571389,290.997188,5.182,5.600
|
||||
198.843858,286.313886,5.142,5.539
|
||||
197.076965,281.642398,5.102,5.479
|
||||
195.319515,276.967602,5.062,5.418
|
||||
193.569611,272.290054,5.022,5.358
|
||||
191.825166,267.610371,4.982,5.297
|
||||
190.084090,262.929171,4.942,5.236
|
||||
188.344295,258.247069,4.903,5.176
|
||||
186.603693,253.564683,4.863,5.115
|
||||
184.860195,248.882630,4.823,5.055
|
||||
183.111713,244.201525,4.783,4.994
|
||||
181.356158,239.521985,4.743,4.934
|
||||
179.591443,234.844628,4.703,4.873
|
||||
177.815478,230.170070,4.664,4.813
|
||||
176.026175,225.498928,4.624,4.752
|
||||
174.221466,220.831812,4.584,4.692
|
||||
172.402865,216.168291,4.544,4.631
|
||||
170.579569,211.505702,4.504,4.571
|
||||
168.761766,206.841091,4.464,4.510
|
||||
166.959647,202.171505,4.424,4.450
|
||||
165.183399,197.493991,4.385,4.389
|
||||
163.443211,192.805596,4.345,4.329
|
||||
161.749274,188.103367,4.305,4.268
|
||||
160.111775,183.384351,4.190,4.272
|
||||
158.540904,178.645594,4.021,4.323
|
||||
157.046851,173.884144,4.128,4.318
|
||||
155.639803,169.097048,4.247,4.300
|
||||
154.329950,164.281352,4.406,4.212
|
||||
153.127482,159.434104,4.493,4.107
|
||||
152.040841,154.553794,4.555,3.996
|
||||
151.071739,149.644481,4.460,4.003
|
||||
150.220267,144.711567,4.332,4.045
|
||||
149.486513,139.760453,4.374,4.113
|
||||
148.870566,134.796540,4.291,4.230
|
||||
148.372516,129.825230,4.183,4.336
|
||||
147.992434,124.851911,4.140,4.294
|
||||
147.726990,119.879465,4.200,4.285
|
||||
147.565511,114.905358,4.313,4.294
|
||||
147.496360,109.926350,4.273,4.313
|
||||
147.507905,104.939200,4.175,4.335
|
||||
147.588509,99.940667,4.077,4.357
|
||||
147.726539,94.927512,4.132,4.316
|
||||
147.909661,89.896706,4.206,4.266
|
||||
148.099958,84.853004,4.281,4.217
|
||||
148.227166,79.811000,4.355,4.167
|
||||
148.218945,74.785923,4.352,4.137
|
||||
148.002954,69.792997,4.281,4.126
|
||||
147.506854,64.847451,4.275,4.132
|
||||
146.658303,59.964509,4.310,4.205
|
||||
145.388472,55.160670,4.205,4.498
|
||||
143.678977,50.470695,4.146,4.624
|
||||
141.549258,45.943039,4.172,4.747
|
||||
139.019670,41.626490,4.262,4.889
|
||||
136.110565,37.569834,4.418,4.983
|
||||
132.842300,33.821858,4.451,4.599
|
||||
129.235227,30.431348,4.451,4.398
|
||||
125.312766,27.436881,4.418,4.409
|
||||
121.120144,24.804331,4.355,4.278
|
||||
116.712056,22.468034,4.270,4.348
|
||||
112.143230,20.362198,4.184,4.427
|
||||
107.468396,18.421033,4.099,4.507
|
||||
102.742286,16.578745,4.048,4.545
|
||||
98.019629,14.769545,4.095,4.463
|
||||
93.342513,12.942394,4.142,4.381
|
||||
88.704216,11.103219,4.189,4.300
|
||||
84.086235,9.271696,4.236,4.218
|
||||
79.470070,7.467499,4.284,4.136
|
||||
74.837217,5.710302,4.331,4.055
|
||||
70.169176,4.019780,4.278,4.105
|
||||
65.447529,2.415476,4.160,4.240
|
||||
60.669630,0.892412,4.042,4.375
|
||||
55.866984,-0.607489,4.038,4.423
|
||||
51.075564,-2.149247,4.236,4.314
|
||||
46.331341,-3.797882,4.434,4.205
|
||||
41.670287,-5.618416,4.632,4.096
|
||||
37.128373,-7.675868,4.635,4.242
|
||||
32.743211,-10.035645,4.623,4.392
|
||||
28.612354,-12.777269,4.606,4.509
|
||||
24.909111,-15.998105,4.888,4.185
|
||||
21.811325,-19.796169,4.673,4.211
|
||||
19.439269,-24.181707,4.222,4.435
|
||||
17.789594,-28.976489,4.444,4.545
|
||||
16.842948,-33.977887,4.564,4.573
|
||||
16.579252,-39.007227,4.818,4.705
|
||||
16.975636,-43.977492,5.060,4.754
|
||||
18.008569,-48.823586,5.137,4.584
|
||||
19.654514,-53.480415,4.896,4.452
|
||||
21.889938,-57.882883,4.802,4.511
|
||||
24.691308,-61.965894,4.744,4.612
|
||||
28.034938,-65.664418,4.670,4.685
|
||||
31.872160,-68.924115,4.762,4.498
|
||||
36.101648,-71.713185,4.797,4.469
|
||||
40.615402,-74.002680,4.672,4.788
|
||||
45.309127,-75.747824,4.864,4.612
|
||||
50.128975,-76.688113,5.130,4.321
|
||||
55.040283,-76.579563,4.952,4.341
|
||||
59.946477,-75.810565,4.752,4.290
|
||||
64.789826,-74.708054,4.543,4.150
|
||||
69.577538,-73.344400,4.460,4.132
|
||||
74.320695,-71.776786,4.424,4.159
|
||||
79.030380,-70.062396,4.388,4.186
|
||||
83.717677,-68.258412,4.352,4.213
|
||||
88.393668,-66.422017,4.316,4.240
|
||||
93.068996,-64.607786,4.280,4.268
|
||||
97.748404,-62.835178,4.244,4.295
|
||||
102.432408,-61.098522,4.208,4.322
|
||||
107.121432,-59.391600,4.172,4.349
|
||||
111.815902,-57.708192,4.136,4.377
|
||||
116.516242,-56.042081,4.100,4.404
|
||||
121.222878,-54.387047,4.064,4.431
|
||||
125.936245,-52.737906,4.028,4.458
|
||||
130.656867,-51.096499,3.992,4.485
|
||||
135.385298,-49.467589,3.956,4.513
|
||||
140.122098,-47.855949,4.007,4.456
|
||||
144.867821,-46.266353,4.087,4.372
|
||||
149.623025,-44.703573,4.167,4.288
|
||||
154.388268,-43.172382,4.247,4.203
|
||||
159.164104,-41.677554,4.298,4.120
|
||||
163.951092,-40.223862,4.334,4.036
|
||||
168.749789,-38.816079,4.370,3.953
|
||||
173.560750,-37.458978,4.405,3.869
|
||||
178.384534,-36.157332,4.254,4.031
|
||||
183.221696,-34.915914,4.064,4.244
|
||||
188.072792,-33.739486,3.874,4.456
|
||||
192.938144,-32.630868,3.876,4.512
|
||||
197.817589,-31.588837,3.951,4.510
|
||||
202.710900,-30.611665,4.026,4.507
|
||||
207.617853,-29.697620,4.115,4.497
|
||||
212.538223,-28.844975,4.216,4.481
|
||||
217.471784,-28.052000,4.345,4.438
|
||||
222.418294,-27.317078,4.570,4.297
|
||||
227.376885,-26.642445,4.794,4.157
|
||||
232.345927,-26.035039,4.806,4.423
|
||||
237.323747,-25.502088,4.795,4.733
|
||||
242.308667,-25.050816,4.804,4.968
|
||||
247.299013,-24.688449,4.870,4.985
|
||||
252.293109,-24.422213,4.936,5.003
|
||||
257.289037,-24.259478,4.961,5.020
|
||||
262.283974,-24.208158,4.971,5.038
|
||||
267.274885,-24.276290,4.800,5.101
|
||||
272.258736,-24.471913,4.628,5.164
|
||||
277.232491,-24.803068,4.505,5.156
|
||||
282.193116,-25.277793,4.486,5.000
|
||||
287.137588,-25.904062,4.466,4.845
|
||||
292.064716,-26.679188,4.474,4.579
|
||||
296.977157,-27.578124,4.488,4.286
|
||||
301.878054,-28.573005,4.503,3.993
|
||||
306.770548,-29.635967,4.404,3.982
|
||||
311.657780,-30.739145,4.285,4.017
|
||||
316.542892,-31.854674,4.167,4.051
|
||||
321.428992,-32.955036,4.096,4.095
|
||||
326.318026,-34.024611,4.133,4.158
|
||||
331.210506,-35.062414,4.169,4.222
|
||||
336.106862,-36.068357,4.205,4.286
|
||||
341.007518,-37.042351,4.225,4.300
|
||||
345.912902,-37.984309,4.219,4.240
|
||||
350.823442,-38.894142,4.214,4.181
|
||||
355.739563,-39.771763,4.209,4.121
|
||||
360.661693,-40.617082,4.204,4.062
|
||||
365.590258,-41.430014,4.198,4.003
|
||||
370.525686,-42.210468,4.181,3.995
|
||||
375.468403,-42.958358,4.141,4.092
|
||||
380.418836,-43.673594,4.100,4.190
|
||||
385.377412,-44.356090,4.194,4.121
|
||||
390.344264,-45.001791,4.371,3.948
|
||||
395.317475,-45.579028,4.443,3.916
|
||||
400.294259,-46.044395,4.418,4.015
|
||||
405.271826,-46.354443,4.385,4.118
|
||||
410.247385,-46.465723,4.282,4.258
|
||||
415.218148,-46.334784,4.178,4.398
|
||||
420.181323,-45.918177,4.224,4.298
|
||||
425.133987,-45.197781,4.323,4.108
|
||||
430.072713,-44.251288,4.344,4.070
|
||||
434.993954,-43.179046,4.316,4.125
|
||||
439.894009,-42.078959,4.281,4.177
|
||||
444.763823,-40.963691,4.231,4.223
|
||||
449.587719,-39.740469,4.201,4.249
|
||||
454.349640,-38.310236,4.266,4.175
|
||||
459.038639,-36.617037,4.326,4.089
|
||||
463.654604,-34.696295,4.371,3.972
|
||||
468.198805,-32.595092,4.383,3.886
|
||||
472.673103,-30.359601,3.976,4.184
|
||||
477.087549,-28.023365,3.990,4.182
|
||||
481.458197,-25.610672,4.119,4.098
|
||||
485.800998,-23.145258,4.249,4.014
|
||||
490.123304,-20.638911,4.379,3.930
|
||||
494.421825,-18.088632,4.371,3.952
|
||||
498.692612,-15.490497,4.249,4.062
|
||||
502.931711,-12.840586,4.126,4.173
|
||||
507.135172,-10.134977,4.004,4.283
|
||||
511.299044,-7.369750,4.089,4.144
|
||||
515.423163,-4.546296,4.176,4.003
|
||||
519.521744,-1.686182,4.263,3.862
|
||||
523.612415,1.184239,4.166,3.903
|
||||
527.712803,4.038614,3.966,4.047
|
||||
531.840536,6.850589,3.819,4.161
|
||||
536.013241,9.593812,3.869,4.167
|
||||
540.248511,12.241964,4.004,4.106
|
||||
544.557752,14.774904,4.127,4.031
|
||||
548.939186,17.185655,4.102,4.026
|
||||
553.389343,19.468929,4.048,4.004
|
||||
557.904756,21.619437,3.997,4.001
|
||||
562.481955,23.631891,3.949,4.032
|
||||
567.117471,25.501002,3.951,4.119
|
||||
571.807805,27.221672,3.978,4.235
|
||||
576.548384,28.795486,4.095,4.320
|
||||
581.333297,30.232374,4.258,4.389
|
||||
586.156546,31.542788,4.369,4.434
|
||||
591.012137,32.737181,4.398,4.439
|
||||
595.894073,33.826004,4.428,4.443
|
||||
600.796359,34.819711,4.342,4.407
|
||||
605.713335,35.726460,4.185,4.346
|
||||
610.644123,36.522011,4.027,4.284
|
||||
615.591378,37.158137,4.053,4.379
|
||||
620.557840,37.586044,4.089,4.483
|
||||
625.544317,37.776802,4.175,4.408
|
||||
630.544207,37.777603,4.261,4.331
|
||||
635.549133,37.653867,4.305,4.272
|
||||
640.551532,37.465775,4.266,4.246
|
||||
645.549590,37.236469,4.228,4.220
|
||||
650.543968,36.973127,4.189,4.195
|
||||
655.535339,36.682867,4.151,4.169
|
||||
660.524373,36.372805,4.113,4.143
|
||||
665.511744,36.050057,4.205,4.209
|
||||
670.498122,35.721741,4.298,4.277
|
||||
675.484179,35.394973,4.392,4.344
|
||||
680.470588,35.076869,4.485,4.411
|
||||
685.458019,34.774546,4.578,4.478
|
||||
690.447146,34.495121,4.672,4.545
|
||||
695.438639,34.245711,4.765,4.612
|
||||
700.433170,34.033432,4.859,4.679
|
||||
705.431408,33.865362,4.912,4.711
|
||||
710.433423,33.741608,4.827,4.620
|
||||
715.437997,33.647216,4.743,4.530
|
||||
720.443740,33.565270,4.658,4.439
|
||||
725.449265,33.478855,4.574,4.348
|
||||
730.453184,33.371056,4.489,4.258
|
||||
735.454108,33.224956,4.405,4.167
|
||||
740.450587,33.023502,4.286,4.211
|
||||
745.438840,32.744590,4.134,4.392
|
||||
750.412147,32.359732,3.981,4.572
|
||||
755.363599,31.840032,3.878,4.650
|
||||
760.286286,31.156595,3.899,4.616
|
||||
765.173300,30.280525,4.058,4.459
|
||||
770.017731,29.182924,4.231,4.252
|
||||
774.811717,27.841028,4.260,4.180
|
||||
779.543702,26.255866,4.236,4.158
|
||||
784.201230,24.434244,4.119,4.268
|
||||
788.771846,22.382966,4.080,4.251
|
||||
793.243097,20.108838,4.203,3.975
|
||||
797.602526,17.618665,4.216,4.021
|
||||
801.837680,14.919252,4.222,4.103
|
||||
805.936103,12.017403,4.226,4.225
|
||||
809.885342,8.919924,4.235,4.237
|
||||
813.672940,5.633620,4.249,4.191
|
||||
817.286445,2.165295,4.283,4.160
|
||||
820.713399,-1.478244,4.332,4.094
|
||||
823.941350,-5.290194,4.351,4.032
|
||||
826.957948,-9.263686,3.868,4.384
|
||||
829.754717,-13.389548,3.924,4.341
|
||||
832.328095,-17.655687,4.092,4.272
|
||||
834.674835,-22.049819,4.085,4.457
|
||||
836.791692,-26.559662,4.044,4.341
|
||||
838.675419,-31.172934,3.951,4.294
|
||||
840.322770,-35.877353,3.873,4.297
|
||||
841.730499,-40.660635,3.942,4.140
|
||||
842.895359,-45.510499,4.032,4.063
|
||||
843.814104,-50.414663,4.113,4.038
|
||||
844.483488,-55.360842,4.079,4.147
|
||||
844.900265,-60.336757,4.221,4.148
|
||||
845.061188,-65.330123,4.272,4.158
|
||||
844.963011,-70.328658,4.222,4.184
|
||||
844.603481,-75.319993,4.123,4.224
|
||||
843.987444,-80.291123,4.229,4.096
|
||||
843.122839,-85.228773,4.214,4.084
|
||||
842.017620,-90.119662,4.126,4.175
|
||||
840.679739,-94.950513,4.017,4.390
|
||||
839.117149,-99.708047,4.070,4.387
|
||||
837.337803,-104.378985,4.045,4.431
|
||||
835.352725,-108.954255,4.002,4.435
|
||||
833.184895,-113.441146,3.951,4.377
|
||||
830.860195,-117.850926,3.900,4.319
|
||||
828.404511,-122.194866,3.849,4.261
|
||||
825.843726,-126.484231,3.798,4.204
|
||||
823.203724,-130.730292,3.811,4.173
|
||||
820.510358,-134.944303,3.852,4.154
|
||||
817.783350,-139.135229,3.894,4.135
|
||||
815.029104,-143.307047,3.935,4.115
|
||||
812.252270,-147.463082,3.976,4.096
|
||||
809.457503,-151.606658,4.018,4.077
|
||||
806.649452,-155.741097,4.043,4.067
|
||||
803.832772,-159.869725,4.035,4.073
|
||||
801.012113,-163.995864,4.028,4.078
|
||||
798.192128,-168.122838,4.021,4.084
|
||||
795.377469,-172.253972,4.014,4.090
|
||||
792.572788,-176.392589,4.006,4.096
|
||||
789.782738,-180.542012,4.016,4.084
|
||||
787.011970,-184.705566,4.062,4.035
|
||||
784.265137,-188.886574,4.108,3.985
|
||||
781.548155,-193.088638,4.154,3.936
|
||||
778.871892,-197.316448,4.187,3.912
|
||||
776.248431,-201.574960,4.213,3.905
|
||||
773.689850,-205.869131,4.226,3.963
|
||||
771.208232,-210.203916,4.218,4.136
|
||||
768.815657,-214.584272,4.326,4.338
|
||||
766.524154,-219.015133,4.587,4.577
|
||||
764.335653,-223.497073,4.847,4.816
|
||||
762.229923,-228.021102,5.174,5.141
|
||||
760.183793,-232.576960,5.514,5.484
|
||||
758.174091,-237.154385,5.854,5.826
|
||||
756.177647,-241.743118,6.194,6.169
|
||||
754.171288,-246.332898,6.534,6.512
|
||||
752.132210,-250.913573,6.875,6.854
|
||||
750.051474,-255.479086,6.929,6.928
|
||||
747.937913,-260.028628,6.935,6.955
|
||||
745.801525,-264.561735,6.941,6.983
|
||||
743.652310,-269.077941,6.947,7.011
|
||||
741.500266,-273.576782,6.953,7.038
|
||||
739.355392,-278.057794,6.959,7.062
|
||||
737.227192,-282.522008,6.957,6.995
|
||||
735.117889,-286.992512,6.954,6.927
|
||||
733.024156,-291.509202,6.952,6.860
|
||||
730.942527,-296.112395,6.949,6.793
|
||||
728.838033,-300.796250,6.947,6.725
|
||||
726.550918,-305.372085,6.816,6.838
|
||||
723.890534,-309.605955,6.657,7.124
|
||||
720.690584,-313.287789,6.919,7.008
|
||||
716.962948,-316.382204,6.936,6.563
|
||||
712.798664,-318.931422,6.330,7.057
|
||||
708.289129,-320.978019,6.497,7.072
|
||||
703.525739,-322.564569,6.586,7.140
|
||||
698.599890,-323.733646,6.635,7.236
|
||||
693.602980,-324.527826,7.056,6.882
|
||||
688.609823,-324.991490,7.328,6.647
|
||||
683.631014,-325.176014,7.024,6.932
|
||||
678.661600,-325.134471,6.721,7.218
|
||||
673.696625,-324.919930,6.832,7.143
|
||||
668.731136,-324.585464,6.953,7.059
|
||||
663.760179,-324.184143,7.018,7.031
|
||||
658.778821,-323.768904,6.947,7.138
|
||||
653.786008,-323.367672,6.875,7.244
|
||||
648.789087,-322.954242,6.929,7.170
|
||||
643.796500,-322.495333,7.011,7.054
|
||||
638.816689,-321.957669,7.093,6.939
|
||||
633.858098,-321.307969,7.122,6.893
|
||||
628.929168,-320.512955,7.079,6.942
|
||||
624.038261,-319.539882,7.030,6.996
|
||||
619.190736,-318.375604,6.783,7.274
|
||||
614.388155,-317.031783,6.537,7.552
|
||||
609.631833,-315.521672,6.759,7.267
|
||||
604.923088,-313.858527,7.030,6.923
|
||||
600.263236,-312.055602,7.123,6.884
|
||||
595.653594,-310.126153,7.190,6.891
|
||||
591.095298,-308.081827,7.140,6.938
|
||||
586.588781,-305.928036,7.021,7.008
|
||||
582.134305,-303.668679,6.893,7.134
|
||||
577.732134,-301.307655,6.749,7.356
|
||||
573.382530,-298.848864,6.804,7.293
|
||||
569.085755,-296.296203,6.932,7.126
|
||||
564.842074,-293.653573,7.060,6.958
|
||||
560.651748,-290.924873,7.039,6.927
|
||||
556.515040,-288.114002,6.945,6.961
|
||||
552.432213,-285.224858,6.856,6.995
|
||||
548.403530,-282.261342,6.963,7.018
|
||||
544.429254,-279.227351,7.071,7.042
|
||||
540.509648,-276.126786,7.045,7.143
|
||||
536.646058,-272.962511,6.921,7.301
|
||||
532.879958,-269.699105,6.796,7.459
|
||||
529.303798,-266.252512,6.800,7.424
|
||||
526.013321,-262.535532,6.982,7.125
|
||||
523.106293,-258.472868,7.046,6.955
|
||||
520.695052,-254.074915,6.962,6.947
|
||||
518.898317,-249.389602,6.882,7.008
|
||||
517.832775,-244.470660,6.727,7.126
|
||||
517.585351,-239.453276,6.760,7.127
|
||||
518.220595,-234.533878,6.960,6.976
|
||||
519.802514,-229.910386,6.644,7.012
|
||||
522.334949,-225.730525,6.697,7.030
|
||||
525.588832,-221.947703,6.723,7.076
|
||||
529.278745,-218.468315,6.755,7.116
|
||||
533.145068,-215.207132,7.006,6.938
|
||||
537.111602,-212.138479,7.135,6.844
|
||||
541.181603,-209.262478,6.882,7.016
|
||||
545.358650,-206.579354,6.630,7.189
|
||||
549.646318,-204.089333,6.583,7.245
|
||||
554.048185,-201.792641,6.776,7.166
|
||||
558.567826,-199.689504,6.962,7.066
|
||||
563.205028,-197.787576,7.142,6.952
|
||||
567.944951,-196.123167,7.104,6.998
|
||||
572.769226,-194.739502,6.943,7.135
|
||||
577.659441,-193.677704,6.782,7.272
|
||||
582.595565,-192.902588,6.832,7.157
|
||||
587.555526,-192.282824,6.891,7.032
|
||||
592.517155,-191.681168,6.950,6.907
|
||||
597.464671,-191.000804,7.008,6.782
|
||||
602.396071,-190.232186,7.067,6.656
|
||||
607.311150,-189.377138,7.078,6.584
|
||||
612.209702,-188.437485,6.754,6.880
|
||||
617.091520,-187.415051,6.736,6.909
|
||||
621.956399,-186.311660,6.885,6.792
|
||||
626.804133,-185.129135,6.995,6.731
|
||||
631.634516,-183.869300,7.081,6.705
|
||||
636.447341,-182.533981,7.031,6.778
|
||||
641.242404,-181.125000,6.926,6.889
|
||||
646.019497,-179.644181,6.822,7.001
|
||||
650.778415,-178.093350,6.911,6.915
|
||||
655.518952,-176.474329,7.032,6.797
|
||||
660.238753,-174.785985,7.152,6.679
|
||||
664.927143,-173.015721,7.144,6.677
|
||||
669.571431,-171.148166,6.832,6.948
|
||||
674.158924,-169.167949,6.519,7.220
|
||||
678.676932,-167.059698,6.652,7.059
|
||||
683.112764,-164.808044,7.010,6.679
|
||||
687.453615,-162.397497,7.367,6.300
|
||||
691.665455,-159.790647,7.318,6.459
|
||||
695.668265,-156.902579,7.235,6.631
|
||||
699.376004,-153.642165,7.092,6.768
|
||||
702.706093,-149.926475,6.881,6.943
|
||||
705.625359,-145.789734,6.597,7.155
|
||||
708.137497,-141.353584,6.711,7.081
|
||||
710.246759,-136.740516,6.913,6.949
|
||||
711.945681,-132.028298,7.275,6.712
|
||||
713.212100,-127.238602,7.271,6.600
|
||||
714.022926,-122.389546,7.233,6.584
|
||||
714.355066,-117.499248,7.183,6.721
|
||||
714.185428,-112.585823,7.151,6.829
|
||||
713.490920,-107.667391,7.131,6.916
|
||||
712.250145,-102.766987,6.929,6.984
|
||||
710.465448,-97.976495,6.713,7.023
|
||||
708.156646,-93.438475,7.013,6.892
|
||||
705.343960,-89.296659,7.275,6.739
|
||||
702.055119,-85.657540,7.465,6.546
|
||||
698.346209,-82.486891,7.379,6.678
|
||||
694.280014,-79.717258,6.996,7.159
|
||||
689.919273,-77.291912,7.046,7.064
|
||||
685.326428,-75.228159,7.189,6.846
|
||||
680.563791,-73.574557,7.133,6.834
|
||||
675.693600,-72.379388,7.037,6.865
|
||||
670.765309,-71.627906,7.088,6.839
|
||||
665.801465,-71.172685,7.209,6.787
|
||||
660.821215,-70.849523,7.175,6.820
|
||||
655.840166,-70.524248,6.962,6.952
|
||||
650.860639,-70.175383,6.793,6.998
|
||||
645.881844,-69.807882,6.707,6.881
|
||||
640.902988,-69.426694,6.621,6.763
|
||||
635.923278,-69.036773,6.535,6.646
|
||||
630.941924,-68.643070,6.449,6.528
|
||||
625.958135,-68.250537,6.363,6.411
|
||||
620.971472,-67.864144,6.277,6.293
|
||||
615.982233,-67.488901,6.192,6.175
|
||||
610.990811,-67.129823,6.093,6.032
|
||||
605.997598,-66.791923,5.973,5.842
|
||||
601.002986,-66.480216,5.852,5.652
|
||||
596.007369,-66.199717,5.791,5.575
|
||||
591.011138,-65.955440,5.734,5.551
|
||||
586.014686,-65.752400,5.650,5.580
|
||||
581.018405,-65.595610,5.565,5.609
|
||||
576.022688,-65.490086,5.481,5.638
|
||||
571.027927,-65.440841,5.534,5.590
|
||||
566.034515,-65.452890,5.705,5.477
|
||||
561.042844,-65.531248,5.876,5.364
|
||||
556.053237,-65.679211,5.782,5.483
|
||||
551.065759,-65.893563,5.623,5.659
|
||||
546.080411,-66.169548,6.015,6.094
|
||||
541.097195,-66.502409,6.506,6.577
|
||||
536.116113,-66.887389,6.677,6.700
|
||||
531.137167,-67.319731,6.553,6.493
|
||||
526.160360,-67.794679,6.430,6.286
|
||||
521.185692,-68.307476,6.306,6.079
|
||||
516.213166,-68.853365,6.182,5.872
|
||||
511.242784,-69.427590,6.058,5.664
|
||||
506.274548,-70.025392,5.935,5.457
|
||||
501.308460,-70.642017,5.896,5.416
|
||||
496.344521,-71.272706,6.002,5.654
|
||||
491.382740,-71.912804,6.107,5.892
|
||||
486.423329,-72.561174,6.212,6.130
|
||||
481.466756,-73.221067,6.318,6.368
|
||||
476.513507,-73.896006,6.381,6.522
|
||||
471.564064,-74.589515,6.270,6.332
|
||||
466.618913,-75.305119,6.158,6.142
|
||||
461.678537,-76.046340,6.047,5.952
|
||||
456.743421,-76.816702,5.936,5.762
|
||||
451.814048,-77.619730,5.824,5.571
|
||||
446.890904,-78.458948,5.713,5.381
|
||||
441.974472,-79.337878,5.621,5.239
|
||||
437.065236,-80.260046,5.595,5.267
|
||||
432.163681,-81.228974,5.570,5.295
|
||||
427.270291,-82.248187,5.544,5.323
|
||||
422.385725,-83.321083,5.518,5.351
|
||||
417.511874,-84.450176,5.515,5.365
|
||||
412.651163,-85.637598,5.517,5.377
|
||||
407.806015,-86.885480,5.518,5.389
|
||||
402.978857,-88.195952,5.519,5.401
|
||||
398.172113,-89.571147,5.520,5.432
|
||||
393.388210,-91.013195,5.520,5.463
|
||||
388.624995,-92.511917,5.520,5.495
|
||||
383.862725,-94.009802,5.520,5.526
|
||||
379.077425,-95.437961,5.521,5.557
|
||||
374.245857,-96.729642,5.517,5.554
|
||||
369.371439,-97.895329,5.513,5.549
|
||||
364.491077,-99.042554,5.509,5.545
|
||||
359.643725,-100.284782,5.510,5.531
|
||||
354.853551,-101.692947,5.546,5.452
|
||||
350.112834,-103.246245,5.582,5.374
|
||||
345.409702,-104.911934,5.649,5.341
|
||||
340.732282,-106.657272,6.154,5.936
|
||||
336.068704,-108.449520,6.658,6.530
|
||||
331.407095,-110.255934,7.163,7.125
|
||||
326.735781,-112.044283,7.177,7.169
|
||||
322.050266,-113.800844,6.985,6.979
|
||||
317.355113,-115.535242,6.792,6.790
|
||||
312.655461,-117.258596,6.599,6.601
|
||||
307.956451,-118.982024,6.406,6.412
|
||||
303.263223,-120.716643,6.214,6.223
|
||||
298.580917,-122.473571,6.021,6.034
|
||||
293.913754,-124.262073,5.828,5.844
|
||||
289.262383,-126.084219,5.816,5.779
|
||||
284.626590,-127.940337,6.002,5.849
|
||||
280.006160,-129.830753,6.188,5.920
|
||||
275.400879,-131.755795,6.375,5.990
|
||||
270.810530,-133.715789,6.561,6.061
|
||||
266.234900,-135.711061,6.747,6.131
|
||||
261.673772,-137.741939,6.916,6.212
|
||||
257.126933,-139.808750,6.896,6.400
|
||||
252.594167,-141.911820,6.877,6.588
|
||||
248.075260,-144.051476,6.857,6.776
|
||||
243.569995,-146.228045,6.837,6.964
|
||||
239.078159,-148.441854,6.817,7.152
|
||||
234.599579,-150.693176,6.982,7.327
|
||||
230.135655,-152.980290,7.413,7.481
|
||||
225.689788,-155.298942,7.844,7.636
|
||||
221.265508,-157.644713,8.276,7.791
|
||||
216.866345,-160.013182,8.296,7.724
|
||||
212.495831,-162.399931,8.123,7.553
|
||||
208.157494,-164.800540,7.950,7.382
|
||||
203.853512,-167.212860,7.777,7.211
|
||||
199.566372,-169.667776,7.604,7.039
|
||||
195.263682,-172.221124,7.431,6.868
|
||||
190.912688,-174.929357,7.258,6.697
|
||||
186.487983,-177.724071,7.078,6.551
|
||||
181.992983,-180.047120,6.789,6.764
|
||||
177.438175,-181.220304,6.203,6.945
|
||||
172.870986,-180.656336,6.339,7.243
|
||||
168.602825,-178.417542,6.636,6.911
|
||||
165.010059,-174.878403,7.071,6.883
|
||||
162.122071,-170.618791,7.181,6.805
|
||||
159.750492,-166.150514,7.152,6.715
|
||||
157.558157,-161.658507,7.123,6.624
|
||||
155.189121,-157.286255,7.093,6.533
|
||||
152.359584,-153.167518,7.064,6.443
|
||||
149.057687,-149.399398,6.723,6.016
|
||||
145.335628,-146.070364,6.197,5.369
|
||||
141.245605,-143.268882,5.813,5.483
|
||||
136.839819,-141.083420,5.615,5.650
|
||||
132.170467,-139.602446,5.607,5.556
|
||||
127.289888,-138.914002,5.642,5.330
|
||||
122.272466,-139.038412,5.431,5.067
|
||||
117.238594,-139.854676,5.131,4.831
|
||||
112.314429,-141.224096,4.822,4.830
|
||||
107.623328,-143.018285,4.742,4.689
|
||||
103.250890,-145.248063,4.859,4.429
|
||||
99.255600,-148.024195,4.934,4.321
|
||||
95.696653,-151.455576,4.649,4.520
|
||||
92.675502,-155.519437,4.528,4.649
|
||||
90.344115,-160.035622,4.667,4.596
|
||||
88.856582,-164.815027,4.703,4.596
|
||||
88.243937,-169.712396,4.812,4.552
|
||||
88.286263,-174.671888,4.788,4.429
|
||||
88.733063,-179.648558,4.874,4.484
|
||||
89.374668,-184.606576,4.960,4.568
|
||||
90.149191,-189.543100,4.955,4.566
|
||||
91.028177,-194.462751,4.950,4.564
|
||||
91.983170,-199.370149,4.945,4.563
|
||||
92.985716,-204.269917,4.940,4.561
|
||||
94.007360,-209.166676,4.934,4.559
|
||||
95.019718,-214.065034,4.929,4.558
|
||||
96.004832,-218.967894,4.924,4.556
|
||||
96.965993,-223.874674,4.919,4.555
|
||||
97.909081,-228.784371,4.914,4.553
|
||||
98.839976,-233.695981,4.909,4.551
|
||||
99.764556,-238.608499,4.904,4.550
|
||||
100.688701,-243.520920,4.898,4.548
|
||||
101.618197,-248.432257,4.893,4.546
|
||||
102.555794,-253.342056,4.888,4.545
|
||||
103.500606,-258.250500,4.883,4.543
|
||||
104.451536,-263.157814,4.878,4.542
|
||||
105.407485,-268.064218,4.873,4.540
|
||||
106.367355,-272.969935,4.868,4.538
|
||||
107.330048,-277.875186,4.862,4.537
|
||||
108.294464,-282.780196,4.857,4.535
|
||||
109.259505,-287.685184,4.852,4.534
|
||||
110.224074,-292.590374,4.847,4.532
|
||||
111.187071,-297.495988,4.842,4.530
|
||||
112.147399,-302.402248,4.837,4.529
|
||||
113.103958,-307.309376,4.832,4.527
|
||||
114.055651,-312.217594,4.826,4.525
|
||||
115.001615,-317.127073,4.821,4.524
|
||||
115.942575,-322.037631,4.816,4.522
|
||||
116.879915,-326.948942,4.811,4.521
|
||||
117.815019,-331.860680,4.806,4.519
|
||||
118.749270,-336.772517,4.801,4.517
|
||||
119.684054,-341.684127,4.795,4.516
|
||||
120.620755,-346.595184,4.790,4.514
|
||||
121.560757,-351.505360,4.785,4.512
|
||||
122.505444,-356.414329,4.780,4.511
|
||||
123.456202,-361.321764,4.775,4.509
|
||||
124.414414,-366.227339,4.770,4.508
|
||||
125.381466,-371.130726,4.765,4.506
|
||||
126.358740,-376.031599,4.759,4.504
|
||||
127.347598,-380.929639,4.754,4.503
|
||||
128.345619,-385.825549,4.749,4.501
|
||||
129.342556,-390.722158,4.744,4.499
|
||||
130.327190,-395.622556,4.739,4.498
|
||||
131.288302,-400.529834,4.734,4.496
|
||||
132.214673,-405.447083,4.729,4.495
|
||||
133.095083,-410.377394,4.683,4.590
|
||||
133.917404,-415.323672,4.623,4.720
|
||||
134.638923,-420.282615,4.457,4.923
|
||||
135.179778,-425.243373,4.219,5.176
|
||||
135.457865,-430.194646,4.345,5.035
|
||||
135.391083,-435.125129,4.520,4.798
|
||||
134.897330,-440.023522,4.740,4.485
|
||||
133.894503,-444.878522,4.971,4.557
|
||||
132.336811,-449.670650,5.116,4.317
|
||||
130.312854,-454.350171,4.238,4.713
|
||||
127.942320,-458.860348,4.493,4.717
|
||||
125.341900,-463.144788,4.832,4.446
|
||||
122.528502,-467.158487,4.407,5.135
|
||||
119.398290,-470.870226,4.540,5.028
|
||||
115.840666,-474.249571,4.692,4.847
|
||||
111.815858,-477.260106,4.796,4.742
|
||||
107.429983,-479.853095,4.993,4.883
|
||||
102.807143,-481.978282,5.144,4.671
|
||||
98.066603,-483.592601,4.997,4.496
|
||||
93.262909,-484.749189,4.346,5.074
|
||||
88.404440,-485.569807,4.216,5.375
|
||||
83.498594,-486.176411,4.600,5.017
|
||||
78.553298,-486.648841,4.913,4.723
|
||||
73.577110,-487.016376,4.873,4.744
|
||||
68.578624,-487.305298,4.832,4.766
|
||||
63.566436,-487.541894,4.792,4.787
|
||||
58.549142,-487.752447,4.752,4.809
|
||||
53.535335,-487.963242,4.712,4.830
|
||||
48.533082,-488.198747,4.671,4.852
|
||||
43.543349,-488.459106,4.631,4.874
|
||||
38.562040,-488.727119,4.591,4.895
|
||||
33.584950,-488.985207,4.550,4.917
|
||||
28.607876,-489.215796,4.510,4.938
|
||||
23.626611,-489.401309,4.494,4.943
|
||||
18.636952,-489.524170,4.592,4.871
|
||||
13.635726,-489.567169,4.690,4.799
|
||||
8.626745,-489.515580,4.791,4.707
|
||||
3.616713,-489.355702,4.905,4.545
|
||||
-1.387655,-489.073840,4.987,4.419
|
||||
-6.379646,-488.656298,4.833,4.555
|
||||
-11.352545,-488.089378,4.681,4.685
|
||||
-16.299639,-487.359387,4.536,4.799
|
||||
-21.214299,-486.455141,4.463,4.853
|
||||
-26.090210,-485.374739,4.576,4.755
|
||||
-30.921130,-484.118421,4.582,4.768
|
||||
-35.700815,-482.686423,4.522,4.848
|
||||
-40.423024,-481.078986,4.498,4.905
|
||||
-45.081514,-479.296347,4.487,4.948
|
||||
-49.670044,-477.338752,4.568,4.879
|
||||
-54.182501,-475.207651,4.658,4.797
|
||||
-58.613044,-472.906981,4.765,4.683
|
||||
-62.955864,-470.440990,4.830,4.597
|
||||
-67.205151,-467.813926,4.720,4.624
|
||||
-71.355097,-465.030037,4.629,4.657
|
||||
-75.399894,-462.093570,4.584,4.703
|
||||
-79.333732,-459.008773,4.692,4.591
|
||||
-83.150802,-455.779894,4.790,4.495
|
||||
-86.845296,-452.411181,4.700,4.618
|
||||
-90.411405,-448.906882,4.501,4.828
|
||||
-93.843320,-445.271244,4.212,5.105
|
||||
-97.135232,-441.508515,4.502,4.728
|
||||
-100.281332,-437.622943,4.692,4.503
|
||||
-103.276256,-433.619225,4.728,4.508
|
||||
-106.116287,-429.503720,4.668,4.614
|
||||
-108.798092,-425.283176,4.513,4.820
|
||||
-111.318336,-420.964340,4.574,4.784
|
||||
-113.673685,-416.553957,4.674,4.702
|
||||
-115.860805,-412.058774,4.708,4.695
|
||||
-117.876362,-407.485538,4.717,4.717
|
||||
-119.717022,-402.840995,4.673,4.745
|
||||
-121.379450,-398.131892,4.621,4.775
|
||||
-122.860313,-393.364976,4.599,4.922
|
||||
-124.156277,-388.546993,4.577,5.032
|
||||
-125.264006,-383.684690,4.597,5.061
|
||||
-126.180169,-378.784813,4.804,4.887
|
||||
-126.901541,-373.854095,4.655,4.719
|
||||
-127.428676,-368.898797,4.516,4.593
|
||||
-127.766739,-363.924608,4.611,4.602
|
||||
-127.921173,-358.937177,4.759,4.548
|
||||
-127.897419,-353.942159,4.812,4.530
|
||||
-127.700923,-348.945204,4.747,4.569
|
||||
-127.337126,-343.951966,4.658,4.569
|
||||
-126.811472,-338.968095,4.573,4.609
|
||||
-126.129405,-333.999244,4.504,4.716
|
||||
-125.296367,-329.051065,4.458,4.741
|
||||
-124.317801,-324.129210,4.449,4.630
|
||||
-123.199151,-319.239331,4.425,4.558
|
||||
-121.945861,-314.387080,4.321,4.705
|
||||
-120.563372,-309.578109,4.473,4.754
|
||||
-119.058509,-304.816715,4.680,4.769
|
||||
-117.447588,-300.097872,4.829,4.771
|
||||
-115.750915,-295.412637,4.896,4.761
|
||||
-113.988811,-290.752052,4.861,4.736
|
||||
-112.181595,-286.107159,4.826,4.711
|
||||
-110.349589,-281.469002,4.791,4.686
|
||||
-108.513113,-276.828622,4.777,4.683
|
||||
-106.688459,-272.178978,4.764,4.680
|
||||
-104.876827,-267.520207,4.750,4.677
|
||||
-103.075877,-262.854130,4.737,4.675
|
||||
-101.283269,-258.182568,4.724,4.672
|
||||
-99.496665,-253.507342,4.711,4.669
|
||||
-97.713725,-248.830270,4.697,4.667
|
||||
-95.932114,-244.153172,4.684,4.664
|
||||
-94.150161,-239.477307,4.671,4.662
|
||||
-92.367593,-234.802761,4.658,4.659
|
||||
-90.584313,-230.129473,4.645,4.656
|
||||
-88.800227,-225.457379,4.631,4.654
|
||||
-87.015237,-220.786419,4.618,4.651
|
||||
-85.229248,-216.116530,4.605,4.648
|
||||
-83.442165,-211.447649,4.592,4.646
|
||||
-81.653892,-206.779715,4.578,4.643
|
||||
-79.864331,-202.112665,4.565,4.640
|
||||
-78.073389,-197.446438,4.552,4.638
|
||||
-76.280968,-192.780971,4.539,4.635
|
||||
-74.486973,-188.116201,4.526,4.632
|
||||
-72.691308,-183.452068,4.512,4.630
|
||||
-70.893901,-178.788517,4.499,4.627
|
||||
-69.094771,-174.125528,4.486,4.624
|
||||
-67.293958,-169.463089,4.473,4.622
|
||||
-65.491502,-164.801187,4.459,4.619
|
||||
-63.687444,-160.139812,4.446,4.617
|
||||
-61.881823,-155.478949,4.433,4.614
|
||||
-60.074681,-150.818588,4.420,4.611
|
||||
-58.266057,-146.158715,4.407,4.609
|
||||
-56.455991,-141.499319,4.393,4.606
|
||||
-54.644524,-136.840387,4.380,4.603
|
||||
-52.831697,-132.181907,4.367,4.601
|
||||
-51.017548,-127.523866,4.392,4.625
|
||||
-49.202119,-122.866254,4.417,4.649
|
||||
-47.385450,-118.209056,4.443,4.672
|
||||
-45.567581,-113.552261,4.468,4.696
|
||||
-43.748552,-108.895857,4.493,4.720
|
||||
-41.928403,-104.239831,4.518,4.744
|
||||
-40.107175,-99.584172,4.544,4.768
|
||||
-38.284908,-94.928866,4.569,4.792
|
||||
-36.461642,-90.273902,4.594,4.816
|
||||
-34.637418,-85.619267,4.619,4.840
|
||||
-32.812275,-80.964950,4.645,4.864
|
||||
-30.986254,-76.310937,4.670,4.888
|
||||
-29.159396,-71.657217,4.695,4.912
|
||||
-27.331740,-67.003778,4.720,4.936
|
||||
-25.503326,-62.350606,4.746,4.960
|
||||
-23.674195,-57.697691,4.771,4.984
|
||||
-21.844388,-53.045019,4.796,5.008
|
||||
-20.013943,-48.392578,4.821,5.032
|
||||
-18.182903,-43.740356,4.847,5.055
|
||||
-16.351306,-39.088341,4.872,5.079
|
||||
-14.519193,-34.436521,4.897,5.103
|
||||
-12.686605,-29.784883,4.923,5.127
|
||||
-10.853581,-25.133415,4.948,5.151
|
||||
-9.020162,-20.482105,4.973,5.175
|
||||
-7.186388,-15.830941,4.998,5.199
|
||||
-5.352300,-11.179909,5.024,5.223
|
||||
-3.517937,-6.528999,5.049,5.247
|
||||
|
@@ -0,0 +1,27 @@
|
||||
Texture2D ShaderTexture : register(t2);
|
||||
SamplerState SampleType : register(s0);
|
||||
|
||||
struct PS_INPUT
|
||||
{
|
||||
float4 Position : SV_POSITION;
|
||||
float2 Tex : TEXCOORD0;
|
||||
float4 Color : COLOR0;
|
||||
};
|
||||
|
||||
struct PS_OUTPUT
|
||||
{
|
||||
float4 RGBColor : SV_TARGET;
|
||||
};
|
||||
|
||||
PS_OUTPUT main(PS_INPUT In)
|
||||
{
|
||||
PS_OUTPUT Output;
|
||||
|
||||
float t = ShaderTexture.Sample(SampleType, In.Tex).r;
|
||||
if (t < 0.5)
|
||||
discard;
|
||||
|
||||
Output.RGBColor = float4(In.Color.rgb, t);
|
||||
|
||||
return Output;
|
||||
}
|
||||
@@ -0,0 +1,35 @@
|
||||
#include "VertexConstants.h"
|
||||
|
||||
struct VS_INPUT
|
||||
{
|
||||
float3 vPos : POSITION;
|
||||
float2 vTex : TEXCOORD0;
|
||||
float4 vCol : COLOR;
|
||||
};
|
||||
|
||||
struct VS_OUTPUT
|
||||
{
|
||||
float4 Position : SV_POSITION;
|
||||
float2 Tex : TEXCOORD0;
|
||||
float4 Color : COLOR0;
|
||||
};
|
||||
|
||||
VS_OUTPUT main(VS_INPUT input)
|
||||
{
|
||||
VS_OUTPUT Output;
|
||||
|
||||
float4 pos = float4(input.vPos, 1.0f);
|
||||
|
||||
// Transform the position from object space to homogeneous projection space
|
||||
pos = mul(View, pos);
|
||||
pos = mul(Projection, pos);
|
||||
Output.Position = pos;
|
||||
|
||||
// Output texture coordinates
|
||||
Output.Tex = input.vTex;
|
||||
|
||||
// Output color
|
||||
Output.Color = input.vCol;
|
||||
|
||||
return Output;
|
||||
}
|
||||
@@ -0,0 +1,19 @@
|
||||
struct PS_INPUT
|
||||
{
|
||||
float4 Position : SV_POSITION;
|
||||
float4 Color : COLOR0;
|
||||
};
|
||||
|
||||
struct PS_OUTPUT
|
||||
{
|
||||
float4 RGBColor : SV_TARGET;
|
||||
};
|
||||
|
||||
PS_OUTPUT main(PS_INPUT In)
|
||||
{
|
||||
PS_OUTPUT Output;
|
||||
|
||||
Output.RGBColor = In.Color;
|
||||
|
||||
return Output;
|
||||
}
|
||||
@@ -0,0 +1,30 @@
|
||||
#include "VertexConstants.h"
|
||||
|
||||
struct VS_INPUT
|
||||
{
|
||||
float3 vPos : POSITION;
|
||||
float3 vColor : COLOR;
|
||||
};
|
||||
|
||||
struct VS_OUTPUT
|
||||
{
|
||||
float4 Position : SV_POSITION;
|
||||
float4 Color : COLOR0;
|
||||
};
|
||||
|
||||
VS_OUTPUT main(VS_INPUT input)
|
||||
{
|
||||
VS_OUTPUT Output;
|
||||
|
||||
float4 pos = float4(input.vPos, 1.0f);
|
||||
|
||||
// Transform the position from object space to homogeneous projection space
|
||||
pos = mul(View, pos);
|
||||
pos = mul(Projection, pos);
|
||||
Output.Position = pos;
|
||||
|
||||
// Output color
|
||||
Output.Color = float4(input.vColor, 1.0f);
|
||||
|
||||
return Output;
|
||||
}
|
||||
@@ -0,0 +1,4 @@
|
||||
// We only write depth, so this shader does nothing
|
||||
void main()
|
||||
{
|
||||
}
|
||||
@@ -0,0 +1,43 @@
|
||||
#include "VertexConstants.h"
|
||||
|
||||
struct VS_INPUT
|
||||
{
|
||||
// Per vertex data
|
||||
float3 vPos : POSITION;
|
||||
float3 vNorm : NORMAL;
|
||||
float2 vTex : TEXCOORD0;
|
||||
float4 vCol : COLOR;
|
||||
|
||||
// Per instance data
|
||||
matrix iModel : INSTANCE_TRANSFORM; // model matrix
|
||||
matrix iModelInvTrans : INSTANCE_INV_TRANSFORM; // (model matrix^-1)^T
|
||||
float4 iCol : INSTANCE_COLOR; // color of the model
|
||||
};
|
||||
|
||||
struct VS_OUTPUT
|
||||
{
|
||||
float4 Position : SV_POSITION;
|
||||
};
|
||||
|
||||
VS_OUTPUT main(VS_INPUT input)
|
||||
{
|
||||
VS_OUTPUT output;
|
||||
|
||||
// Check if the alpha = 0
|
||||
if (input.vCol.a * input.iCol.a == 0.0)
|
||||
{
|
||||
// Don't draw the triangle by moving it to an invalid location
|
||||
output.Position = float4(0, 0, 0, 0);
|
||||
}
|
||||
else
|
||||
{
|
||||
// Transform the position from world space to homogeneous projection space for the light
|
||||
float4 pos = float4(input.vPos, 1.0f);
|
||||
pos = mul(input.iModel, pos);
|
||||
pos = mul(LightView, pos);
|
||||
pos = mul(LightProjection, pos);
|
||||
output.Position = pos;
|
||||
}
|
||||
|
||||
return output;
|
||||
}
|
||||
@@ -0,0 +1,121 @@
|
||||
// Shader that uses a shadow map for rendering shadows, see:
|
||||
// http://www.opengl-tutorial.org/intermediate-tutorials/tutorial-16-shadow-mapping/
|
||||
// https://takinginitiative.wordpress.com/2011/05/25/directx10-tutorial-10-shadow-mapping-part-2/
|
||||
|
||||
Texture2D LightDepthTexture : register(t2);
|
||||
SamplerComparisonState LightDepthSampler : register(s2);
|
||||
|
||||
cbuffer PixelShaderConstantBuffer : register(b1)
|
||||
{
|
||||
float3 CameraPos;
|
||||
float3 LightPos;
|
||||
};
|
||||
|
||||
struct PS_INPUT
|
||||
{
|
||||
float4 Position : SV_POSITION; // interpolated vertex position
|
||||
float3 Normal : TEXCOORD0;
|
||||
float3 WorldPos : TEXCOORD1;
|
||||
float2 Tex : TEXCOORD2;
|
||||
float4 PositionL : TEXCOORD3; // interpolated vertex position in light space
|
||||
float4 Color : COLOR0;
|
||||
};
|
||||
|
||||
struct PS_OUTPUT
|
||||
{
|
||||
float4 RGBColor : SV_TARGET;
|
||||
};
|
||||
|
||||
PS_OUTPUT main(PS_INPUT input)
|
||||
{
|
||||
// Constants
|
||||
float AmbientFactor = 0.3;
|
||||
float3 DiffuseColor = float3(input.Color.r, input.Color.g, input.Color.b);
|
||||
float3 SpecularColor = float3(1, 1, 1);
|
||||
float SpecularPower = 100.0;
|
||||
float bias = 1.0e-7;
|
||||
|
||||
// Homogenize position in light space
|
||||
input.PositionL.xyz /= input.PositionL.w;
|
||||
|
||||
// Calculate dot product between direction to light and surface normal and clamp between [0, 1]
|
||||
float3 view_dir = normalize(CameraPos - input.WorldPos);
|
||||
float3 world_to_light = LightPos - input.WorldPos;
|
||||
float3 light_dir = normalize(world_to_light);
|
||||
float3 normal = normalize(input.Normal);
|
||||
if (dot(view_dir, normal) < 0) // If we're viewing the triangle from the back side, flip the normal to get the correct lighting
|
||||
normal = -normal;
|
||||
float normal_dot_light_dir = saturate(dot(normal, light_dir));
|
||||
|
||||
// Calculate texture coordinates in light depth texture
|
||||
float2 tex_coord;
|
||||
tex_coord.x = input.PositionL.x / 2.0 + 0.5;
|
||||
tex_coord.y = -input.PositionL.y / 2.0 + 0.5;
|
||||
|
||||
// Check that the texture coordinate is inside the depth texture, if not we don't know if it is lit or not so we assume lit
|
||||
float shadow_factor = 1.0;
|
||||
if (input.Color.a > 0 // Alpha = 0 means don't receive shadows
|
||||
&& tex_coord.x == saturate(tex_coord.x) && tex_coord.y == saturate(tex_coord.y))
|
||||
{
|
||||
// Modify shadow bias according to the angle between the normal and the light dir
|
||||
float modified_bias = bias * tan(acos(normal_dot_light_dir));
|
||||
modified_bias = min(modified_bias, 10.0 * bias);
|
||||
|
||||
// Get texture size
|
||||
float width, height, levels;
|
||||
LightDepthTexture.GetDimensions(0, width, height, levels);
|
||||
width = 1.0 / width;
|
||||
height = 1.0 / height;
|
||||
|
||||
// Samples to take
|
||||
uint num_samples = 16;
|
||||
float2 offsets[] = {
|
||||
float2(-1.5 * width, -1.5 * height),
|
||||
float2(-0.5 * width, -1.5 * height),
|
||||
float2(0.5 * width, -1.5 * height),
|
||||
float2(1.5 * width, -1.5 * height),
|
||||
|
||||
float2(-1.5 * width, -0.5 * height),
|
||||
float2(-0.5 * width, -0.5 * height),
|
||||
float2(0.5 * width, -0.5 * height),
|
||||
float2(1.5 * width, -0.5 * height),
|
||||
|
||||
float2(-1.5 * width, 0.5 * height),
|
||||
float2(-0.5 * width, 0.5 * height),
|
||||
float2(0.5 * width, 0.5 * height),
|
||||
float2(1.5 * width, 0.5 * height),
|
||||
|
||||
float2(-1.5 * width, 1.5 * height),
|
||||
float2(-0.5 * width, 1.5 * height),
|
||||
float2(0.5 * width, 1.5 * height),
|
||||
float2(1.5 * width, 1.5 * height),
|
||||
};
|
||||
|
||||
// Calculate depth of this pixel relative to the light
|
||||
float light_depth = input.PositionL.z + modified_bias;
|
||||
|
||||
// Sample shadow factor
|
||||
shadow_factor = 0.0;
|
||||
[unroll] for (uint i = 0; i < num_samples; ++i)
|
||||
shadow_factor += LightDepthTexture.SampleCmp(LightDepthSampler, tex_coord + offsets[i], light_depth);
|
||||
shadow_factor /= num_samples;
|
||||
}
|
||||
|
||||
// Calculate diffuse and specular
|
||||
float diffuse = normal_dot_light_dir;
|
||||
float specular = diffuse > 0.0? pow(saturate(-dot(reflect(light_dir, normal), view_dir)), SpecularPower) : 0.0;
|
||||
|
||||
// Apply procedural pattern based on the uv coordinates
|
||||
bool2 less_half = input.Tex - floor(input.Tex) < float2(0.5, 0.5);
|
||||
float darken_factor = less_half.r ^ less_half.g? 0.5 : 1.0;
|
||||
|
||||
// Fade out checkerboard pattern when it tiles too often
|
||||
float2 dx = ddx(input.Tex), dy = ddy(input.Tex);
|
||||
float texel_distance = sqrt(dot(dx, dx) + dot(dy, dy));
|
||||
darken_factor = lerp(darken_factor, 0.75, clamp(5.0 * texel_distance - 1.5, 0.0, 1.0));
|
||||
|
||||
// Calculate color
|
||||
PS_OUTPUT output;
|
||||
output.RGBColor = float4(saturate((AmbientFactor + diffuse * shadow_factor) * darken_factor * DiffuseColor + SpecularColor * specular * shadow_factor), 1);
|
||||
return output;
|
||||
}
|
||||
@@ -0,0 +1,59 @@
|
||||
#include "VertexConstants.h"
|
||||
|
||||
struct VS_INPUT
|
||||
{
|
||||
// Per vertex data
|
||||
float3 vPos : POSITION;
|
||||
float3 vNorm : NORMAL;
|
||||
float2 vTex : TEXCOORD0;
|
||||
float4 vCol : COLOR;
|
||||
|
||||
// Per instance data
|
||||
matrix iModel : INSTANCE_TRANSFORM; // model matrix
|
||||
matrix iModelInvTrans : INSTANCE_INV_TRANSFORM; // (model matrix^-1)^T
|
||||
float4 iCol : INSTANCE_COLOR; // color of the model
|
||||
};
|
||||
|
||||
struct VS_OUTPUT
|
||||
{
|
||||
float4 Position : SV_POSITION;
|
||||
float3 Normal : TEXCOORD0;
|
||||
float3 WorldPos : TEXCOORD1;
|
||||
float2 Tex : TEXCOORD2;
|
||||
float4 PositionL : TEXCOORD3;
|
||||
float4 Color : COLOR0;
|
||||
};
|
||||
|
||||
VS_OUTPUT main(VS_INPUT input)
|
||||
{
|
||||
VS_OUTPUT output;
|
||||
|
||||
// Get world position
|
||||
float4 pos = float4(input.vPos, 1.0f);
|
||||
float4 world_pos = mul(input.iModel, pos);
|
||||
|
||||
// Transform the position from world space to homogeneous projection space
|
||||
float4 proj_pos = mul(View, world_pos);
|
||||
proj_pos = mul(Projection, proj_pos);
|
||||
output.Position = proj_pos;
|
||||
|
||||
// Transform the position from world space to projection space of the light
|
||||
float4 proj_lpos = mul(LightView, world_pos);
|
||||
proj_lpos = mul(LightProjection, proj_lpos);
|
||||
output.PositionL = proj_lpos;
|
||||
|
||||
// output normal
|
||||
float4 norm = float4(input.vNorm, 0.0f);
|
||||
output.Normal = normalize(mul(input.iModelInvTrans, norm).xyz);
|
||||
|
||||
// output world position of the vertex
|
||||
output.WorldPos = world_pos.xyz;
|
||||
|
||||
// output texture coordinates
|
||||
output.Tex = input.vTex;
|
||||
|
||||
// output color
|
||||
output.Color = input.vCol * input.iCol;
|
||||
|
||||
return output;
|
||||
}
|
||||
@@ -0,0 +1,23 @@
|
||||
Texture2D ShaderTexture : register(t2);
|
||||
SamplerState SampleType : register(s1);
|
||||
|
||||
struct PS_INPUT
|
||||
{
|
||||
float4 Position : SV_POSITION;
|
||||
float2 Tex : TEXCOORD0;
|
||||
float4 Color : COLOR0;
|
||||
};
|
||||
|
||||
struct PS_OUTPUT
|
||||
{
|
||||
float4 RGBColor : SV_TARGET;
|
||||
};
|
||||
|
||||
PS_OUTPUT main(PS_INPUT In)
|
||||
{
|
||||
PS_OUTPUT Output;
|
||||
|
||||
Output.RGBColor = In.Color * ShaderTexture.Sample(SampleType, In.Tex);
|
||||
|
||||
return Output;
|
||||
}
|
||||
@@ -0,0 +1,20 @@
|
||||
struct PS_INPUT
|
||||
{
|
||||
float4 Position : SV_POSITION;
|
||||
float2 Tex : TEXCOORD0;
|
||||
float4 Color : COLOR0;
|
||||
};
|
||||
|
||||
struct PS_OUTPUT
|
||||
{
|
||||
float4 RGBColor : SV_TARGET;
|
||||
};
|
||||
|
||||
PS_OUTPUT main(PS_INPUT In)
|
||||
{
|
||||
PS_OUTPUT Output;
|
||||
|
||||
Output.RGBColor = In.Color;
|
||||
|
||||
return Output;
|
||||
}
|
||||
@@ -0,0 +1,34 @@
|
||||
#include "VertexConstants.h"
|
||||
|
||||
struct VS_INPUT
|
||||
{
|
||||
float3 vPos : POSITION;
|
||||
float2 vTex : TEXCOORD0;
|
||||
float4 vCol : COLOR;
|
||||
};
|
||||
|
||||
struct VS_OUTPUT
|
||||
{
|
||||
float4 Position : SV_POSITION;
|
||||
float2 Tex : TEXCOORD0;
|
||||
float4 Color : COLOR0;
|
||||
};
|
||||
|
||||
VS_OUTPUT main(VS_INPUT input)
|
||||
{
|
||||
VS_OUTPUT Output;
|
||||
|
||||
float4 pos = float4(input.vPos, 1.0f);
|
||||
|
||||
// Transform the position from object space to ortho space
|
||||
pos = mul(Projection, pos);
|
||||
Output.Position = pos;
|
||||
|
||||
// Output texture coordinates
|
||||
Output.Tex = input.vTex;
|
||||
|
||||
// Output color
|
||||
Output.Color = input.vCol;
|
||||
|
||||
return Output;
|
||||
}
|
||||
@@ -0,0 +1,7 @@
|
||||
cbuffer VertexShaderConstantBuffer : register(b0)
|
||||
{
|
||||
matrix View; // view matrix
|
||||
matrix Projection; // projection matrix
|
||||
matrix LightView; // view matrix of the light
|
||||
matrix LightProjection; // projection matrix of the light
|
||||
};
|
||||
@@ -0,0 +1,39 @@
|
||||
#include <metal_stdlib>
|
||||
|
||||
using namespace metal;
|
||||
|
||||
#include "VertexConstants.h"
|
||||
|
||||
constexpr sampler alphaTextureSampler(mag_filter::linear, min_filter::linear);
|
||||
|
||||
struct FontVertex
|
||||
{
|
||||
float3 vPos [[attribute(0)]];
|
||||
float2 vTex [[attribute(1)]];
|
||||
uchar4 vCol [[attribute(2)]];
|
||||
};
|
||||
|
||||
struct FontOut
|
||||
{
|
||||
float4 oPosition [[position]];
|
||||
float2 oTex;
|
||||
float4 oColor;
|
||||
};
|
||||
|
||||
vertex FontOut FontVertexShader(FontVertex vert [[stage_in]], constant VertexShaderConstantBuffer *constants [[buffer(2)]])
|
||||
{
|
||||
FontOut out;
|
||||
out.oPosition = constants->Projection * constants->View * float4(vert.vPos, 1.0);
|
||||
out.oTex = vert.vTex;
|
||||
out.oColor = float4(vert.vCol) / 255.0;
|
||||
return out;
|
||||
}
|
||||
|
||||
fragment float4 FontPixelShader(FontOut in [[stage_in]], texture2d<float> alphaTexture [[texture(0)]])
|
||||
{
|
||||
const float4 sample = alphaTexture.sample(alphaTextureSampler, in.oTex);
|
||||
if (sample.x < 0.5)
|
||||
discard_fragment();
|
||||
|
||||
return float4(in.oColor.xyz, sample.x);
|
||||
}
|
||||
@@ -0,0 +1,30 @@
|
||||
#include <metal_stdlib>
|
||||
|
||||
using namespace metal;
|
||||
|
||||
#include "VertexConstants.h"
|
||||
|
||||
struct LineVertex
|
||||
{
|
||||
float3 iPosition [[attribute(0)]];
|
||||
uchar4 iColor [[attribute(1)]];
|
||||
};
|
||||
|
||||
struct LineOut
|
||||
{
|
||||
float4 oPosition [[position]];
|
||||
float4 oColor;
|
||||
};
|
||||
|
||||
vertex LineOut LineVertexShader(LineVertex vert [[stage_in]], constant VertexShaderConstantBuffer *constants [[buffer(2)]])
|
||||
{
|
||||
LineOut out;
|
||||
out.oPosition = constants->Projection * constants->View * float4(vert.iPosition, 1.0);
|
||||
out.oColor = float4(vert.iColor) / 255.0;
|
||||
return out;
|
||||
}
|
||||
|
||||
fragment float4 LinePixelShader(LineOut in [[stage_in]])
|
||||
{
|
||||
return in.oColor;
|
||||
}
|
||||
@@ -0,0 +1,199 @@
|
||||
#include <metal_stdlib>
|
||||
|
||||
using namespace metal;
|
||||
|
||||
#include "VertexConstants.h"
|
||||
|
||||
constexpr sampler depthSampler(mag_filter::nearest, min_filter::nearest);
|
||||
|
||||
struct Vertex
|
||||
{
|
||||
float3 vPos [[attribute(0)]];
|
||||
float3 vNorm [[attribute(1)]];
|
||||
float2 vTex [[attribute(2)]];
|
||||
uchar4 vCol [[attribute(3)]];
|
||||
float4 iModel0 [[attribute(4)]];
|
||||
float4 iModel1 [[attribute(5)]];
|
||||
float4 iModel2 [[attribute(6)]];
|
||||
float4 iModel3 [[attribute(7)]];
|
||||
float4 iModelInvTrans0 [[attribute(8)]];
|
||||
float4 iModelInvTrans1 [[attribute(9)]];
|
||||
float4 iModelInvTrans2 [[attribute(10)]];
|
||||
float4 iModelInvTrans3 [[attribute(11)]];
|
||||
uchar4 iCol [[attribute(12)]];
|
||||
};
|
||||
|
||||
struct TriangleOut
|
||||
{
|
||||
float4 oPosition [[position]];
|
||||
float3 oNormal;
|
||||
float3 oWorldPos;
|
||||
float2 oTex;
|
||||
float4 oPositionL;
|
||||
float4 oColor;
|
||||
};
|
||||
|
||||
vertex TriangleOut TriangleVertexShader(Vertex vert [[stage_in]], constant VertexShaderConstantBuffer *constants [[buffer(2)]])
|
||||
{
|
||||
TriangleOut out;
|
||||
|
||||
// Convert input matrices
|
||||
float4x4 iModel(vert.iModel0, vert.iModel1, vert.iModel2, vert.iModel3);
|
||||
float4x4 iModelInvTrans(vert.iModelInvTrans0, vert.iModelInvTrans1, vert.iModelInvTrans2, vert.iModelInvTrans3);
|
||||
|
||||
// Get world position
|
||||
float4 pos = float4(vert.vPos, 1.0f);
|
||||
float4 world_pos = iModel * pos;
|
||||
|
||||
// Transform the position from world space to homogeneous projection space
|
||||
float4 proj_pos = constants->View * world_pos;
|
||||
proj_pos = constants->Projection * proj_pos;
|
||||
out.oPosition = proj_pos;
|
||||
|
||||
// Transform the position from world space to projection space of the light
|
||||
float4 proj_lpos = constants->LightView * world_pos;
|
||||
proj_lpos = constants->LightProjection * proj_lpos;
|
||||
out.oPositionL = proj_lpos;
|
||||
|
||||
// output normal
|
||||
float4 norm = float4(vert.vNorm, 0.0f);
|
||||
out.oNormal = normalize(iModelInvTrans * norm).xyz;
|
||||
|
||||
// output world position of the vertex
|
||||
out.oWorldPos = world_pos.xyz;
|
||||
|
||||
// output texture coordinates
|
||||
out.oTex = vert.vTex;
|
||||
|
||||
// output color
|
||||
out.oColor = float4(vert.vCol) * float4(vert.iCol) / (255.0 * 255.0);
|
||||
|
||||
return out;
|
||||
}
|
||||
|
||||
fragment float4 TrianglePixelShader(TriangleOut vert [[stage_in]], constant PixelShaderConstantBuffer *constants, texture2d<float> depthTexture [[texture(0)]])
|
||||
{
|
||||
// Constants
|
||||
float AmbientFactor = 0.3;
|
||||
float3 DiffuseColor = float3(vert.oColor.r, vert.oColor.g, vert.oColor.b);
|
||||
float3 SpecularColor = float3(1, 1, 1);
|
||||
float SpecularPower = 100.0;
|
||||
float bias = 1.0e-7;
|
||||
|
||||
// Homogenize position in light space
|
||||
float3 position_l = vert.oPositionL.xyz / vert.oPositionL.w;
|
||||
|
||||
// Calculate dot product between direction to light and surface normal and clamp between [0, 1]
|
||||
float3 view_dir = normalize(constants->CameraPos - vert.oWorldPos);
|
||||
float3 world_to_light = constants->LightPos - vert.oWorldPos;
|
||||
float3 light_dir = normalize(world_to_light);
|
||||
float3 normal = normalize(vert.oNormal);
|
||||
if (dot(view_dir, normal) < 0) // If we're viewing the triangle from the back side, flip the normal to get the correct lighting
|
||||
normal = -normal;
|
||||
float normal_dot_light_dir = clamp(dot(normal, light_dir), 0.0, 1.0);
|
||||
|
||||
// Calculate texture coordinates in light depth texture
|
||||
float2 tex_coord;
|
||||
tex_coord.x = position_l.x / 2.0 + 0.5;
|
||||
tex_coord.y = -position_l.y / 2.0 + 0.5;
|
||||
|
||||
// Check that the texture coordinate is inside the depth texture, if not we don't know if it is lit or not so we assume lit
|
||||
float shadow_factor = 1.0;
|
||||
if (vert.oColor.a > 0 // Alpha = 0 means don't receive shadows
|
||||
&& tex_coord.x == clamp(tex_coord.x, 0.0, 1.0) && tex_coord.y == clamp(tex_coord.y, 0.0, 1.0))
|
||||
{
|
||||
// Modify shadow bias according to the angle between the normal and the light dir
|
||||
float modified_bias = bias * tan(acos(normal_dot_light_dir));
|
||||
modified_bias = min(modified_bias, 10.0 * bias);
|
||||
|
||||
// Get texture size
|
||||
float width = 1.0 / 4096;
|
||||
float height = 1.0 / 4096;
|
||||
|
||||
// Samples to take
|
||||
uint num_samples = 16;
|
||||
float2 offsets[] = {
|
||||
float2(-1.5 * width, -1.5 * height),
|
||||
float2(-0.5 * width, -1.5 * height),
|
||||
float2(0.5 * width, -1.5 * height),
|
||||
float2(1.5 * width, -1.5 * height),
|
||||
|
||||
float2(-1.5 * width, -0.5 * height),
|
||||
float2(-0.5 * width, -0.5 * height),
|
||||
float2(0.5 * width, -0.5 * height),
|
||||
float2(1.5 * width, -0.5 * height),
|
||||
|
||||
float2(-1.5 * width, 0.5 * height),
|
||||
float2(-0.5 * width, 0.5 * height),
|
||||
float2(0.5 * width, 0.5 * height),
|
||||
float2(1.5 * width, 0.5 * height),
|
||||
|
||||
float2(-1.5 * width, 1.5 * height),
|
||||
float2(-0.5 * width, 1.5 * height),
|
||||
float2(0.5 * width, 1.5 * height),
|
||||
float2(1.5 * width, 1.5 * height),
|
||||
};
|
||||
|
||||
// Calculate depth of this pixel relative to the light
|
||||
float light_depth = position_l.z + modified_bias;
|
||||
|
||||
// Sample shadow factor
|
||||
shadow_factor = 0.0;
|
||||
for (uint i = 0; i < num_samples; ++i)
|
||||
shadow_factor += depthTexture.sample(depthSampler, tex_coord + offsets[i]).x <= light_depth? 1.0 : 0.0;
|
||||
shadow_factor /= num_samples;
|
||||
}
|
||||
|
||||
// Calculate diffuse and specular
|
||||
float diffuse = normal_dot_light_dir;
|
||||
float specular = diffuse > 0.0? pow(clamp(-dot(reflect(light_dir, normal), view_dir), 0.0, 1.0), SpecularPower) : 0.0;
|
||||
|
||||
// Apply procedural pattern based on the uv coordinates
|
||||
bool2 less_half = (vert.oTex - floor(vert.oTex)) < float2(0.5, 0.5);
|
||||
float darken_factor = less_half.r ^ less_half.g? 0.5 : 1.0;
|
||||
|
||||
// Fade out checkerboard pattern when it tiles too often
|
||||
float2 dx = dfdx(vert.oTex), dy = dfdy(vert.oTex);
|
||||
float texel_distance = sqrt(dot(dx, dx) + dot(dy, dy));
|
||||
darken_factor = mix(darken_factor, 0.75, clamp(5.0 * texel_distance - 1.5, 0.0, 1.0));
|
||||
|
||||
// Calculate color
|
||||
return float4(clamp((AmbientFactor + diffuse * shadow_factor) * darken_factor * DiffuseColor + SpecularColor * specular * shadow_factor, 0, 1), 1);
|
||||
}
|
||||
|
||||
struct DepthOut
|
||||
{
|
||||
float4 oPosition [[position]];
|
||||
};
|
||||
|
||||
vertex DepthOut TriangleDepthVertexShader(Vertex vert [[stage_in]], constant VertexShaderConstantBuffer *constants [[buffer(2)]])
|
||||
{
|
||||
DepthOut out;
|
||||
|
||||
// Check if the alpha = 0
|
||||
if (vert.vCol.a * vert.iCol.a == 0.0)
|
||||
{
|
||||
// Don't draw the triangle by moving it to an invalid location
|
||||
out.oPosition = float4(0, 0, 0, 0);
|
||||
}
|
||||
else
|
||||
{
|
||||
// Convert input matrix
|
||||
float4x4 iModel(vert.iModel0, vert.iModel1, vert.iModel2, vert.iModel3);
|
||||
|
||||
// Transform the position from world space to homogeneous projection space for the light
|
||||
float4 pos = float4(vert.vPos, 1.0f);
|
||||
pos = iModel * pos;
|
||||
pos = constants->LightView * pos;
|
||||
pos = constants->LightProjection * pos;
|
||||
out.oPosition = pos;
|
||||
}
|
||||
|
||||
return out;
|
||||
}
|
||||
|
||||
fragment float4 TriangleDepthPixelShader(DepthOut in [[stage_in]])
|
||||
{
|
||||
// We only write depth, so this shader does nothing
|
||||
return float4(0.0, 0.0, 0.0, 1.0);
|
||||
}
|
||||
@@ -0,0 +1,41 @@
|
||||
#include <metal_stdlib>
|
||||
|
||||
using namespace metal;
|
||||
|
||||
#include "VertexConstants.h"
|
||||
|
||||
constexpr sampler uiTextureSampler(mag_filter::linear, min_filter::linear);
|
||||
|
||||
struct UIVertex
|
||||
{
|
||||
float3 vPos [[attribute(0)]];
|
||||
float2 vTex [[attribute(1)]];
|
||||
uchar4 vCol [[attribute(2)]];
|
||||
};
|
||||
|
||||
struct UIOut
|
||||
{
|
||||
float4 oPosition [[position]];
|
||||
float2 oTex;
|
||||
float4 oColor;
|
||||
};
|
||||
|
||||
vertex UIOut UIVertexShader(UIVertex vert [[stage_in]], constant VertexShaderConstantBuffer *constants [[buffer(2)]])
|
||||
{
|
||||
UIOut out;
|
||||
out.oPosition = constants->Projection * constants->View * float4(vert.vPos, 1.0);
|
||||
out.oTex = vert.vTex;
|
||||
out.oColor = float4(vert.vCol) / 255.0;
|
||||
return out;
|
||||
}
|
||||
|
||||
fragment float4 UIPixelShader(UIOut in [[stage_in]], texture2d<float> uiTexture [[texture(0)]])
|
||||
{
|
||||
const float4 sample = uiTexture.sample(uiTextureSampler, in.oTex);
|
||||
return sample * in.oColor;
|
||||
}
|
||||
|
||||
fragment float4 UIPixelShaderUntextured(UIOut in [[stage_in]])
|
||||
{
|
||||
return in.oColor;
|
||||
}
|
||||
@@ -0,0 +1,13 @@
|
||||
struct VertexShaderConstantBuffer
|
||||
{
|
||||
float4x4 View; // view matrix
|
||||
float4x4 Projection; // projection matrix
|
||||
float4x4 LightView; // view matrix of the light
|
||||
float4x4 LightProjection; // projection matrix of the light
|
||||
};
|
||||
|
||||
struct PixelShaderConstantBuffer
|
||||
{
|
||||
float3 CameraPos;
|
||||
float3 LightPos;
|
||||
};
|
||||
@@ -0,0 +1,17 @@
|
||||
#version 450
|
||||
|
||||
layout(set = 1, binding = 0) uniform sampler2D texSampler;
|
||||
|
||||
layout(location = 0) in vec2 iTex;
|
||||
layout(location = 1) in vec4 iColor;
|
||||
|
||||
layout(location = 0) out vec4 oColor;
|
||||
|
||||
void main()
|
||||
{
|
||||
float t = texture(texSampler, iTex).x;
|
||||
if (t < 0.5)
|
||||
discard;
|
||||
|
||||
oColor = vec4(iColor.xyz, t);
|
||||
}
|
||||
@@ -0,0 +1,17 @@
|
||||
#version 450
|
||||
|
||||
#include "VertexConstants.h"
|
||||
|
||||
layout(location = 0) in vec3 vPos;
|
||||
layout(location = 1) in vec2 vTex;
|
||||
layout(location = 2) in vec4 vCol;
|
||||
|
||||
layout(location = 0) out vec2 oTex;
|
||||
layout(location = 1) out vec4 oColor;
|
||||
|
||||
void main()
|
||||
{
|
||||
gl_Position = c.Projection * c.View * vec4(vPos, 1.0f);
|
||||
oTex = vTex;
|
||||
oColor = vCol;
|
||||
}
|
||||
@@ -0,0 +1,10 @@
|
||||
#version 450
|
||||
|
||||
layout(location = 0) in vec4 iColor;
|
||||
|
||||
layout(location = 0) out vec4 oColor;
|
||||
|
||||
void main()
|
||||
{
|
||||
oColor = iColor;
|
||||
}
|
||||
@@ -0,0 +1,14 @@
|
||||
#version 450
|
||||
|
||||
#include "VertexConstants.h"
|
||||
|
||||
layout(location = 0) in vec3 iPosition;
|
||||
layout(location = 1) in vec4 iColor;
|
||||
|
||||
layout(location = 0) out vec4 oColor;
|
||||
|
||||
void main()
|
||||
{
|
||||
gl_Position = c.Projection * c.View * vec4(iPosition, 1.0);
|
||||
oColor = iColor;
|
||||
}
|
||||
@@ -0,0 +1,6 @@
|
||||
#version 450
|
||||
|
||||
// We only write depth, so this shader does nothing
|
||||
void main()
|
||||
{
|
||||
}
|
||||
@@ -0,0 +1,31 @@
|
||||
#version 450
|
||||
|
||||
#include "VertexConstants.h"
|
||||
|
||||
layout(location = 0) in vec3 vPos;
|
||||
layout(location = 1) in vec3 vNorm;
|
||||
layout(location = 2) in vec2 vTex;
|
||||
layout(location = 3) in vec4 vCol;
|
||||
|
||||
layout(location = 4) in mat4 iModel;
|
||||
layout(location = 8) in mat4 iModelInvTrans;
|
||||
layout(location = 12) in vec4 iCol;
|
||||
|
||||
void main()
|
||||
{
|
||||
// Check if the alpha = 0
|
||||
if (vCol.a * iCol.a == 0.0)
|
||||
{
|
||||
// Don't draw the triangle by moving it to an invalid location
|
||||
gl_Position = vec4(0, 0, 0, 0);
|
||||
}
|
||||
else
|
||||
{
|
||||
// Transform the position from world space to homogeneous projection space for the light
|
||||
vec4 pos = vec4(vPos, 1.0f);
|
||||
pos = iModel * pos;
|
||||
pos = c.LightView * pos;
|
||||
pos = c.LightProjection * pos;
|
||||
gl_Position = pos;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,107 @@
|
||||
#version 450
|
||||
|
||||
layout(binding = 1) uniform PixelShaderConstantBuffer
|
||||
{
|
||||
vec3 CameraPos;
|
||||
vec3 LightPos;
|
||||
} c;
|
||||
|
||||
layout(location = 0) in vec3 iNormal;
|
||||
layout(location = 1) in vec3 iWorldPos;
|
||||
layout(location = 2) in vec2 iTex;
|
||||
layout(location = 3) in vec4 iPositionL;
|
||||
layout(location = 4) in vec4 iColor;
|
||||
|
||||
layout(location = 0) out vec4 oColor;
|
||||
|
||||
layout(set = 1, binding = 0) uniform sampler2D LightDepthSampler;
|
||||
|
||||
void main()
|
||||
{
|
||||
// Constants
|
||||
float AmbientFactor = 0.3;
|
||||
vec3 DiffuseColor = vec3(iColor.r, iColor.g, iColor.b);
|
||||
vec3 SpecularColor = vec3(1, 1, 1);
|
||||
float SpecularPower = 100.0;
|
||||
float bias = 1.0e-7;
|
||||
|
||||
// Homogenize position in light space
|
||||
vec3 position_l = iPositionL.xyz / iPositionL.w;
|
||||
|
||||
// Calculate dot product between direction to light and surface normal and clamp between [0, 1]
|
||||
vec3 view_dir = normalize(c.CameraPos - iWorldPos);
|
||||
vec3 world_to_light = c.LightPos - iWorldPos;
|
||||
vec3 light_dir = normalize(world_to_light);
|
||||
vec3 normal = normalize(iNormal);
|
||||
if (dot(view_dir, normal) < 0) // If we're viewing the triangle from the back side, flip the normal to get the correct lighting
|
||||
normal = -normal;
|
||||
float normal_dot_light_dir = clamp(dot(normal, light_dir), 0, 1);
|
||||
|
||||
// Calculate texture coordinates in light depth texture
|
||||
vec2 tex_coord;
|
||||
tex_coord.x = position_l.x / 2.0 + 0.5;
|
||||
tex_coord.y = position_l.y / 2.0 + 0.5;
|
||||
|
||||
// Check that the texture coordinate is inside the depth texture, if not we don't know if it is lit or not so we assume lit
|
||||
float shadow_factor = 1.0;
|
||||
if (iColor.a > 0 // Alpha = 0 means don't receive shadows
|
||||
&& tex_coord.x == clamp(tex_coord.x, 0, 1) && tex_coord.y == clamp(tex_coord.y, 0, 1))
|
||||
{
|
||||
// Modify shadow bias according to the angle between the normal and the light dir
|
||||
float modified_bias = bias * tan(acos(normal_dot_light_dir));
|
||||
modified_bias = min(modified_bias, 10.0 * bias);
|
||||
|
||||
// Get texture size
|
||||
float width = 1.0 / 4096;
|
||||
float height = 1.0 / 4096;
|
||||
|
||||
// Samples to take
|
||||
uint num_samples = 16;
|
||||
vec2 offsets[] = {
|
||||
vec2(-1.5 * width, -1.5 * height),
|
||||
vec2(-0.5 * width, -1.5 * height),
|
||||
vec2(0.5 * width, -1.5 * height),
|
||||
vec2(1.5 * width, -1.5 * height),
|
||||
|
||||
vec2(-1.5 * width, -0.5 * height),
|
||||
vec2(-0.5 * width, -0.5 * height),
|
||||
vec2(0.5 * width, -0.5 * height),
|
||||
vec2(1.5 * width, -0.5 * height),
|
||||
|
||||
vec2(-1.5 * width, 0.5 * height),
|
||||
vec2(-0.5 * width, 0.5 * height),
|
||||
vec2(0.5 * width, 0.5 * height),
|
||||
vec2(1.5 * width, 0.5 * height),
|
||||
|
||||
vec2(-1.5 * width, 1.5 * height),
|
||||
vec2(-0.5 * width, 1.5 * height),
|
||||
vec2(0.5 * width, 1.5 * height),
|
||||
vec2(1.5 * width, 1.5 * height),
|
||||
};
|
||||
|
||||
// Calculate depth of this pixel relative to the light
|
||||
float light_depth = position_l.z + modified_bias;
|
||||
|
||||
// Sample shadow factor
|
||||
shadow_factor = 0.0;
|
||||
for (uint i = 0; i < num_samples; ++i)
|
||||
shadow_factor += texture(LightDepthSampler, tex_coord + offsets[i]).x <= light_depth? 1.0 : 0.0;
|
||||
shadow_factor /= num_samples;
|
||||
}
|
||||
|
||||
// Calculate diffuse and specular
|
||||
float diffuse = normal_dot_light_dir;
|
||||
float specular = diffuse > 0.0? pow(clamp(-dot(reflect(light_dir, normal), view_dir), 0, 1), SpecularPower) : 0.0;
|
||||
|
||||
// Apply procedural pattern based on the uv coordinates
|
||||
bvec2 less_half = lessThan(iTex - floor(iTex), vec2(0.5, 0.5));
|
||||
float darken_factor = less_half.r ^^ less_half.g? 0.5 : 1.0;
|
||||
|
||||
// Fade out checkerboard pattern when it tiles too often
|
||||
vec2 dx = dFdx(iTex), dy = dFdy(iTex);
|
||||
float texel_distance = sqrt(dot(dx, dx) + dot(dy, dy));
|
||||
darken_factor = mix(darken_factor, 0.75, clamp(5.0 * texel_distance - 1.5, 0.0, 1.0));
|
||||
|
||||
// Calculate color
|
||||
oColor = vec4(clamp((AmbientFactor + diffuse * shadow_factor) * darken_factor * DiffuseColor + SpecularColor * specular * shadow_factor, 0, 1), 1);
|
||||
}
|
||||
@@ -0,0 +1,48 @@
|
||||
#version 450
|
||||
|
||||
#include "VertexConstants.h"
|
||||
|
||||
layout(location = 0) in vec3 vPos;
|
||||
layout(location = 1) in vec3 vNorm;
|
||||
layout(location = 2) in vec2 vTex;
|
||||
layout(location = 3) in vec4 vCol;
|
||||
|
||||
layout(location = 4) in mat4 iModel;
|
||||
layout(location = 8) in mat4 iModelInvTrans;
|
||||
layout(location = 12) in vec4 iCol;
|
||||
|
||||
layout(location = 0) out vec3 oNormal;
|
||||
layout(location = 1) out vec3 oWorldPos;
|
||||
layout(location = 2) out vec2 oTex;
|
||||
layout(location = 3) out vec4 oPositionL;
|
||||
layout(location = 4) out vec4 oColor;
|
||||
|
||||
void main()
|
||||
{
|
||||
// Get world position
|
||||
vec4 pos = vec4(vPos, 1.0f);
|
||||
vec4 world_pos = iModel * pos;
|
||||
|
||||
// Transform the position from world space to homogeneous projection space
|
||||
vec4 proj_pos = c.View * world_pos;
|
||||
proj_pos = c.Projection * proj_pos;
|
||||
gl_Position = proj_pos;
|
||||
|
||||
// Transform the position from world space to projection space of the light
|
||||
vec4 proj_lpos = c.LightView * world_pos;
|
||||
proj_lpos = c.LightProjection * proj_lpos;
|
||||
oPositionL = proj_lpos;
|
||||
|
||||
// output normal
|
||||
vec4 norm = vec4(vNorm, 0.0f);
|
||||
oNormal = normalize(iModelInvTrans * norm).xyz;
|
||||
|
||||
// output world position of the vertex
|
||||
oWorldPos = world_pos.xyz;
|
||||
|
||||
// output texture coordinates
|
||||
oTex = vTex;
|
||||
|
||||
// output color
|
||||
oColor = vCol * iCol;
|
||||
}
|
||||
@@ -0,0 +1,13 @@
|
||||
#version 450
|
||||
|
||||
layout(set = 1, binding = 0) uniform sampler2D texSampler;
|
||||
|
||||
layout(location = 0) in vec4 iColor;
|
||||
layout(location = 1) in vec2 iTex;
|
||||
|
||||
layout(location = 0) out vec4 oColor;
|
||||
|
||||
void main()
|
||||
{
|
||||
oColor = iColor * texture(texSampler, iTex);
|
||||
}
|
||||
@@ -0,0 +1,10 @@
|
||||
#version 450
|
||||
|
||||
layout(location = 0) in vec4 iColor;
|
||||
|
||||
layout(location = 0) out vec4 oColor;
|
||||
|
||||
void main()
|
||||
{
|
||||
oColor = iColor;
|
||||
}
|
||||
@@ -0,0 +1,17 @@
|
||||
#version 450
|
||||
|
||||
#include "VertexConstants.h"
|
||||
|
||||
layout(location = 0) in vec3 vPos;
|
||||
layout(location = 1) in vec2 vTex;
|
||||
layout(location = 2) in vec4 vCol;
|
||||
|
||||
layout(location = 0) out vec4 oColor;
|
||||
layout(location = 1) out vec2 oTex;
|
||||
|
||||
void main()
|
||||
{
|
||||
gl_Position = c.Projection * c.View * vec4(vPos, 1.0f);
|
||||
oTex = vTex;
|
||||
oColor = vCol;
|
||||
}
|
||||
@@ -0,0 +1,7 @@
|
||||
layout(binding = 0) uniform VertexShaderConstantBuffer
|
||||
{
|
||||
mat4 View;
|
||||
mat4 Projection;
|
||||
mat4 LightView;
|
||||
mat4 LightProjection;
|
||||
} c;
|
||||
Vendored
BIN
Binary file not shown.
|
After Width: | Height: | Size: 64 KiB |
BIN
Binary file not shown.
BIN
Binary file not shown.
BIN
Binary file not shown.
BIN
Binary file not shown.
Vendored
+7
@@ -0,0 +1,7 @@
|
||||
/Linux*
|
||||
/WASM*
|
||||
/VS20*
|
||||
/XCode*
|
||||
/MinGW*
|
||||
/Doxygen
|
||||
/CoverageReport
|
||||
+5
@@ -0,0 +1,5 @@
|
||||
.idea
|
||||
.gradle
|
||||
.cxx
|
||||
build
|
||||
local.properties
|
||||
@@ -0,0 +1,51 @@
|
||||
plugins {
|
||||
id 'com.android.application'
|
||||
}
|
||||
|
||||
android {
|
||||
compileSdk 33
|
||||
ndkVersion "26.1.10909125"
|
||||
|
||||
defaultConfig {
|
||||
applicationId "com.joltphysics.performancetest"
|
||||
minSdk 21
|
||||
targetSdk 33
|
||||
versionCode 1
|
||||
versionName "1.0"
|
||||
ndk.abiFilters 'arm64-v8a', 'armeabi-v7a', 'x86_64', 'x86'
|
||||
|
||||
externalNativeBuild {
|
||||
cmake {
|
||||
cppFlags '-std=c++17 -Wall -Werror -ffp-model=precise -ffp-contract=off -DJPH_PROFILE_ENABLED -DJPH_DEBUG_RENDERER'
|
||||
arguments '-DANDROID_TOOLCHAIN=clang', '-DANDROID_STL=c++_static', '-DCROSS_PLATFORM_DETERMINISTIC=ON'
|
||||
}
|
||||
}
|
||||
signingConfig signingConfigs.debug
|
||||
}
|
||||
|
||||
buildTypes {
|
||||
release {
|
||||
minifyEnabled false
|
||||
}
|
||||
}
|
||||
|
||||
compileOptions {
|
||||
sourceCompatibility JavaVersion.VERSION_1_8
|
||||
targetCompatibility JavaVersion.VERSION_1_8
|
||||
}
|
||||
|
||||
externalNativeBuild {
|
||||
cmake {
|
||||
path file('src/main/cpp/CMakeLists.txt')
|
||||
version '3.22.1'
|
||||
}
|
||||
}
|
||||
|
||||
buildFeatures {
|
||||
viewBinding true
|
||||
}
|
||||
namespace 'com.joltphysics.performancetest'
|
||||
}
|
||||
|
||||
dependencies {
|
||||
}
|
||||
@@ -0,0 +1,20 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<manifest xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
|
||||
<application
|
||||
android:allowBackup="true"
|
||||
android:label="Jolt Physics Performance Test"
|
||||
android:supportsRtl="false"
|
||||
android:theme="@android:style/Theme.NoTitleBar.Fullscreen">
|
||||
<activity
|
||||
android:name="android.app.NativeActivity"
|
||||
android:exported="true">
|
||||
<meta-data android:name="android.app.lib_name" android:value="PerformanceTest"/>
|
||||
<intent-filter>
|
||||
<action android:name="android.intent.action.MAIN"/>
|
||||
<category android:name="android.intent.category.LAUNCHER"/>
|
||||
</intent-filter>
|
||||
</activity>
|
||||
</application>
|
||||
|
||||
</manifest>
|
||||
@@ -0,0 +1,20 @@
|
||||
cmake_minimum_required(VERSION 3.10.2)
|
||||
|
||||
project("JoltPhysicsPerformanceTest")
|
||||
|
||||
# Make sure we include the app glue sources
|
||||
set(APP_GLUE_DIR ${ANDROID_NDK}/sources/android/native_app_glue)
|
||||
include_directories(${APP_GLUE_DIR})
|
||||
|
||||
# Set repository root
|
||||
set(PHYSICS_REPO_ROOT "${CMAKE_CURRENT_SOURCE_DIR}/../../../../../../")
|
||||
|
||||
# Make targets
|
||||
include(${PHYSICS_REPO_ROOT}/Jolt/Jolt.cmake)
|
||||
include(${PHYSICS_REPO_ROOT}/PerformanceTest/PerformanceTest.cmake)
|
||||
|
||||
# Link shared native library
|
||||
set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} -u ANativeActivity_onCreate")
|
||||
add_library(PerformanceTest SHARED ${PERFORMANCE_TEST_SRC_FILES} ${APP_GLUE_DIR}/android_native_app_glue.c)
|
||||
target_include_directories(PerformanceTest PUBLIC Jolt ${JOLT_PHYSICS_ROOT} ${PERFORMANCE_TEST_ROOT})
|
||||
target_link_libraries(PerformanceTest Jolt android log)
|
||||
@@ -0,0 +1,51 @@
|
||||
plugins {
|
||||
id 'com.android.application'
|
||||
}
|
||||
|
||||
android {
|
||||
compileSdk 33
|
||||
ndkVersion "26.1.10909125"
|
||||
|
||||
defaultConfig {
|
||||
applicationId "com.joltphysics.unittests"
|
||||
minSdk 21
|
||||
targetSdk 33
|
||||
versionCode 1
|
||||
versionName "1.0"
|
||||
ndk.abiFilters 'arm64-v8a', 'armeabi-v7a', 'x86_64', 'x86'
|
||||
|
||||
externalNativeBuild {
|
||||
cmake {
|
||||
cppFlags '-std=c++17 -Wall -Werror -ffp-contract=off -DJPH_PROFILE_ENABLED -DJPH_DEBUG_RENDERER'
|
||||
arguments '-DANDROID_TOOLCHAIN=clang', '-DANDROID_STL=c++_static'
|
||||
}
|
||||
}
|
||||
signingConfig signingConfigs.debug
|
||||
}
|
||||
|
||||
buildTypes {
|
||||
release {
|
||||
minifyEnabled false
|
||||
}
|
||||
}
|
||||
|
||||
compileOptions {
|
||||
sourceCompatibility JavaVersion.VERSION_1_8
|
||||
targetCompatibility JavaVersion.VERSION_1_8
|
||||
}
|
||||
|
||||
externalNativeBuild {
|
||||
cmake {
|
||||
path file('src/main/cpp/CMakeLists.txt')
|
||||
version '3.22.1'
|
||||
}
|
||||
}
|
||||
|
||||
buildFeatures {
|
||||
viewBinding true
|
||||
}
|
||||
namespace 'com.joltphysics.unittests'
|
||||
}
|
||||
|
||||
dependencies {
|
||||
}
|
||||
@@ -0,0 +1,20 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<manifest xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
|
||||
<application
|
||||
android:allowBackup="true"
|
||||
android:label="Jolt Physics Unit Tests"
|
||||
android:supportsRtl="false"
|
||||
android:theme="@android:style/Theme.NoTitleBar.Fullscreen">
|
||||
<activity
|
||||
android:name="android.app.NativeActivity"
|
||||
android:exported="true">
|
||||
<meta-data android:name="android.app.lib_name" android:value="UnitTests"/>
|
||||
<intent-filter>
|
||||
<action android:name="android.intent.action.MAIN"/>
|
||||
<category android:name="android.intent.category.LAUNCHER"/>
|
||||
</intent-filter>
|
||||
</activity>
|
||||
</application>
|
||||
|
||||
</manifest>
|
||||
@@ -0,0 +1,20 @@
|
||||
cmake_minimum_required(VERSION 3.10.2)
|
||||
|
||||
project("JoltPhysicsUnitTests")
|
||||
|
||||
# Make sure we include the app glue sources
|
||||
set(APP_GLUE_DIR ${ANDROID_NDK}/sources/android/native_app_glue)
|
||||
include_directories(${APP_GLUE_DIR})
|
||||
|
||||
# Set repository root
|
||||
set(PHYSICS_REPO_ROOT "${CMAKE_CURRENT_SOURCE_DIR}/../../../../../../")
|
||||
|
||||
# Make targets
|
||||
include(${PHYSICS_REPO_ROOT}/Jolt/Jolt.cmake)
|
||||
include(${PHYSICS_REPO_ROOT}/UnitTests/UnitTests.cmake)
|
||||
|
||||
# Link shared native library
|
||||
set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} -u ANativeActivity_onCreate")
|
||||
add_library(UnitTests SHARED ${UNIT_TESTS_SRC_FILES} ${APP_GLUE_DIR}/android_native_app_glue.c)
|
||||
target_include_directories(UnitTests PUBLIC Jolt ${JOLT_PHYSICS_ROOT} ${UNIT_TESTS_ROOT})
|
||||
target_link_libraries(UnitTests Jolt android log)
|
||||
+17
@@ -0,0 +1,17 @@
|
||||
// Top-level build file where you can add configuration options common to all sub-projects/modules.
|
||||
buildscript {
|
||||
repositories {
|
||||
google()
|
||||
mavenCentral()
|
||||
}
|
||||
dependencies {
|
||||
classpath 'com.android.tools.build:gradle:8.7.2'
|
||||
|
||||
// NOTE: Do not place your application dependencies here; they belong
|
||||
// in the individual module build.gradle files
|
||||
}
|
||||
}
|
||||
|
||||
task clean(type: Delete) {
|
||||
delete rootProject.buildDir
|
||||
}
|
||||
@@ -0,0 +1,21 @@
|
||||
# Project-wide Gradle settings.
|
||||
# IDE (e.g. Android Studio) users:
|
||||
# Gradle settings configured through the IDE *will override*
|
||||
# any settings specified in this file.
|
||||
# For more details on how to configure your build environment visit
|
||||
# http://www.gradle.org/docs/current/userguide/build_environment.html
|
||||
# Specifies the JVM arguments used for the daemon process.
|
||||
# The setting is particularly useful for tweaking memory settings.
|
||||
org.gradle.jvmargs=-Xmx2048m -Dfile.encoding=UTF-8
|
||||
# When configured, Gradle will run in incubating parallel mode.
|
||||
# This option should only be used with decoupled projects. More details, visit
|
||||
# http://www.gradle.org/docs/current/userguide/multi_project_builds.html#sec:decoupled_projects
|
||||
# org.gradle.parallel=true
|
||||
# AndroidX package structure to make it clearer which packages are bundled with the
|
||||
# Android operating system, and which are packaged with your app"s APK
|
||||
# https://developer.android.com/topic/libraries/support-library/androidx-rn
|
||||
android.useAndroidX=true
|
||||
# Automatically convert third-party libraries to use AndroidX
|
||||
android.enableJetifier=true
|
||||
android.nonTransitiveRClass=false
|
||||
android.nonFinalResIds=false
|
||||
Binary file not shown.
@@ -0,0 +1,5 @@
|
||||
distributionBase=GRADLE_USER_HOME
|
||||
distributionUrl=https\://services.gradle.org/distributions/gradle-8.9-bin.zip
|
||||
distributionPath=wrapper/dists
|
||||
zipStorePath=wrapper/dists
|
||||
zipStoreBase=GRADLE_USER_HOME
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user