Compare commits

..
15 Commits
Author SHA1 Message Date
Ling ZhanandGitHub fce5974adb update bullet, physx for debug draw (#419) 2023-09-08 16:33:10 +08:00
minggoandGitHub 8e329d5897 Merge pull request #418 from cocos/v3.8.1
V3.8.1
2023-09-08 14:32:59 +08:00
Zeqiang LiandGitHub 00e4b6c23a update webgpu (#417) 2023-09-08 14:15:26 +08:00
Ling ZhanandGitHub e0776e986f update bullet wasm: [fix] cct scaling causes trigger event missing (#416) 2023-09-01 11:44:04 +08:00
CanvasandGitHub c634ab5511 update spine wasm & asm, fix event data bind. (#410)
* update spine wasm & asm, fix event data bind.

* update spine wasm & asm to fix event data.

* update spine wasm & asm api.

* update spine wasm & asm to fix const string.
2023-09-01 11:22:43 +08:00
minggoandGitHub 6d39435119 support hmi
V3.8.2 merges v3.8.0-hmi
2023-09-01 10:32:40 +08:00
James Chen 9ca49d770a Merge branch 'v3.8.0-hmi' into v3.8.2 2023-09-01 10:28:50 +08:00
Ling ZhanandGitHub e1afa91277 update box2dwasm (#413) 2023-08-31 14:19:19 +08:00
minggoandGitHub 8fef1505b4 Merge pull request #383 from dumganhar/v3.8.0-hmi
v3.8.0-hmi merges v3.8.0
2023-07-11 17:43:38 +08:00
James Chen 772894d6a0 Merge branch 'v3.8.0' of github.com:cocos/cocos-engine-external into v3.8.0-hmi 2023-07-11 17:39:43 +08:00
minggoandGitHub d30c066419 Merge pull request #357 from dumganhar/v3.8.0-hmi
v3.8.0-hmi branch merges v3.7.2-hmi
2023-06-05 16:41:52 +08:00
James Chen ab15deb121 Merge branch 'v3.8.0' of github.com:cocos/cocos-engine-external into v3.7.2-hmi 2023-06-05 13:51:02 +08:00
江战andGitHub 0fd7ff8de9 Merge pull request #344 from PatriceJiang/v3.7.2-hmi
support dynamic library loading
2023-04-24 14:34:43 +08:00
Patrice Jiang 651482be4f support dynamic library loading 2023-04-20 16:24:56 +08:00
James ChenandGitHub b701539f22 Update sources/CMakeLists.txt, add configuration for surfaceless mode (#341) 2023-04-17 16:06:37 +08:00
37 changed files with 35261 additions and 32515 deletions
+5 -2
View File
@@ -84,7 +84,8 @@ if(USE_SE_V8)
IMPORTED_LOCATION ${platform_spec_path}/v8/libinspector.a
INTERFACE_INCLUDE_DIRECTORIES ${platform_spec_path}/include/v8
)
set(se_libs_name v8_monolith v8_inspector)
set(se_libs_name v8_monolith)
set(se_libs_include ${platform_spec_path}/include/v8)
endif()
if(USE_WEBSOCKET_SERVER)
@@ -160,7 +161,9 @@ endif()
set(ZLIB z)
if(NOT USE_MODULES)
list(APPEND CC_EXTERNAL_LIBS ${ZLIB} ${se_libs_name})
list(APPEND CC_EXTERNAL_LIBS ${ZLIB}
${se_libs_name}
)
endif()
+9
View File
@@ -185,6 +185,7 @@ declare namespace B2 {
GetFilterData(): Filter;
Refilter(): void;
GetBody(): Body;
GetNext(): Fixture;
TestPoint(p: Vec2): boolean;
RayCast(output: RayCastOutput, input: RayCastInput, childIndex: number): boolean;
GetMassData(massData: MassData): void;
@@ -272,6 +273,8 @@ declare namespace B2 {
IsEnabled(): boolean;
SetFixedRotation(flag: boolean): void;
IsFixedRotation(): boolean;
GetFixtureList(): Fixture;
GetJointList(): number;
GetWorld(): World;
Dump(): void;
}
@@ -572,4 +575,10 @@ declare namespace B2 {
function ContactImpulseGetNormalImpulse(contactImpulsePtr: number, index: number): number;
function ContactImpulseGetTangentImpulse(contactImpulsePtr: number, index: number): number;
function ContactImpulseGetCount(contactImpulsePtr: number): number;
//JointEdge
function JointEdgeGetOther(jointEdgePtr: number): number;
function JointEdgeGetJoint(jointEdgePtr: number): number;
function JointEdgeGetPrev(jointEdgePtr: number): number;
function JointEdgeGetNext(jointEdgePtr: number): number;
}
File diff suppressed because one or more lines are too long
Binary file not shown.
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
Binary file not shown.
File diff suppressed because one or more lines are too long
+19 -3
View File
@@ -42,6 +42,8 @@ declare namespace Bullet {
// constraints
TypedConstraint_getFixedBody(): ptr;
TypedConstraint_getDbgDrawSize(): number;
TypedConstraint_setDbgDrawSize(p: ptr, dbgDrawSize: number): void;
HingeConstraint_new(ptr0: ptr, ptr1: ptr, ptr2: ptr, ptr3: ptr): ptr;
HingeConstraint_setFrames(ptr0: ptr, ptr1: ptr, ptr2: ptr): void;
HingeConstraint_setLimit(p: ptr, low: number, upper: number, softness: number, biasFactor: number, relaxationFactor: number): void;
@@ -208,6 +210,8 @@ declare namespace Bullet {
CollisionWorld_removeCollisionObject(p: ptr, body: ptr): void;
CollisionWorld_rayTest(p: ptr, p0: ptr, p1: ptr, p2: ptr): void;
CollisionWorld_convexSweepTest(p: ptr, castShape: ptr, from: ptr, to: ptr, resultCallback: ptr, allowedCcdPenetration: ptr): void;
CollisionWorld_setDebugDrawer(p: ptr, drawer: ptr): void;
CollisionWorld_debugDrawWorld(p: ptr): void;
ccDiscreteDynamicsWorld_new(dispatcher: ptr, pairCache: ptr, solver: ptr): ptr;
ccDiscreteDynamicsWorld_setAllowSleep(p: ptr, v: boolean): void;
@@ -220,6 +224,18 @@ declare namespace Bullet {
DynamicsWorld_addAction(p: ptr, action: ptr): void;
DynamicsWorld_removeAction(p: ptr, action: ptr): void;
DebugDraw_new(): ptr;
DebugDraw_setDebugMode(p: ptr, debugMode: number): void;
DebugDraw_getDebugMode(p: ptr): number;
DebugDraw_setActiveObjectColor(p: ptr, r: number, g: number, b: number): void;
DebugDraw_setDeactiveObjectColor(p: ptr, r: number, g: number, b: number): void;
DebugDraw_setWantsDeactivationObjectColor(p: ptr, r: number, g: number, b: number): void;
DebugDraw_setDisabledDeactivationObjectColor(p: ptr, r: number, g: number, b: number): void;
DebugDraw_setDisabledSimulationObjectColor(p: ptr, r: number, g: number, b: number): void;
DebugDraw_setAABBColor(p: ptr, r: number, g: number, b: number): void;
DebugDraw_setContactPointColor(p: ptr, r: number, g: number, b: number): void;
DebugDraw_setConstraintLimitColor(p: ptr, r: number, g: number, b: number): void;
RayCallback_hasHit(p: ptr): boolean;
ConvexCallback_hasHit(p: ptr): boolean;
@@ -263,19 +279,19 @@ declare namespace Bullet {
ControllerHit_getHitMotionLength(p: ptr): number; //CCT hit Motion length
ControllerShapeHit_getHitShape(p: ptr): ptr;
ControllerShapeHit_getHitCollisionObject(p: ptr): ptr;
CharacterController_move(ptrCCT: ptr, ptrMovement: ptr, minDist: number, deltaTime: number):number;
CharacterController_move(ptrCCT: ptr, ptrMovement: ptr, minDist: number, deltaTime: number): number;
CharacterController_getPosition(ptrCCT: ptr);
CharacterController_setContactOffset(ptrCCT: ptr, v: number);
CharacterController_setStepOffset(ptrCCT: ptr, v: number);
CharacterController_setSlopeLimit(ptrCCT: ptr, v: number);
CharacterController_setCollision(ptrCCT: ptr, collision: boolean);
CharacterController_setOverlapRecovery(ptrCCT: ptr, value: boolean);
CapsuleCharacterControllerDesc_new(maxSlopeRadians: number, stepHeight: number, contactOffset: number,
CapsuleCharacterControllerDesc_new(maxSlopeRadians: number, stepHeight: number, contactOffset: number,
ptrUpAxis: ptr, ptrInitPos: ptr, ptruUserControllerHitReport: ptr, radius: number, height: number): ptr;
CapsuleCharacterController_new(collisionWorld: ptr, ptrBtCapsuleCharacterControllerDesc: ptr, userObjectPointer: ptr): ptr;
CapsuleCharacterController_setRadius(ptrCCT: ptr, radius: number): void;
CapsuleCharacterController_setHeight(ptrCCT: ptr, height: number): void;
BoxCharacterControllerDesc_new(maxSlopeRadians: number, stepHeight: number, contactOffset: number,
BoxCharacterControllerDesc_new(maxSlopeRadians: number, stepHeight: number, contactOffset: number,
ptrUpAxis: ptr, ptrInitPos: ptr, ptruUserControllerHitReport: ptr, halfHeight: number, halfSideExtent: number, halfForwardExtent: number): ptr;
BoxCharacterController_new(collisionWorld: ptr, ptrBtBoxCharacterControllerDesc: ptr, userObjectPointer: ptr): ptr;
BoxCharacterController_setHalfHeight(ptrCCT: ptr, v: number): void;
Binary file not shown.
+113 -116
View File
@@ -1,4 +1,3 @@
interface Vec3 {
x: number, y: number, z: number
}
@@ -17,7 +16,7 @@ interface FilterData {
declare namespace phy {
/// Base ///
const physics: Physics
const physics: Physics;
abstract class Physics {
private constructor ()
createCooking (cp: CookingParams): Cooking
@@ -350,8 +349,6 @@ declare namespace phy {
/// Joints ///
/// Extensions ///
interface Spring {
@@ -615,22 +612,22 @@ declare namespace phy {
class SceneQueryHit {
private constructor ()
actor: RigidActor
shape: Shape
faceIndex: number
actor: RigidActor;
shape: Shape;
faceIndex: number;
}
class RayCastHit {
private constructor ()
actor: RigidActor
shape: Shape
faceIndex: number
u: number
v: number
normal: Vec3
position: Vec3
distance: number
flags: number
actor: RigidActor;
shape: Shape;
faceIndex: number;
u: number;
v: number;
normal: Vec3;
position: Vec3;
distance: number;
flags: number;
}
type preFilter = (filterData: FilterData, shape: Shape, actor: RigidActor, hitFlags: number) => QueryHitType
@@ -695,7 +692,7 @@ declare namespace phy {
/**
\brief Internal flag, used by #PxContactPair.extractContacts()
The applied contact impulses are provided for every contact point.
The applied contact impulses are provided for every contact point.
This is the case if #PxPairFlag::eSOLVE_CONTACT has been set for the pair.
*/
eINTERNAL_HAS_IMPULSES = (1 << 4),
@@ -728,9 +725,9 @@ declare namespace phy {
/**
\brief Call contact report callback or trigger callback when this collision pair starts to be in contact.
If one of the two collision objects is a trigger shape (see #PxShapeFlag::eTRIGGER_SHAPE)
then the trigger callback will get called as soon as the other object enters the trigger volume.
If none of the two collision objects is a trigger shape then the contact report callback will get
If one of the two collision objects is a trigger shape (see #PxShapeFlag::eTRIGGER_SHAPE)
then the trigger callback will get called as soon as the other object enters the trigger volume.
If none of the two collision objects is a trigger shape then the contact report callback will get
called when the actors of this collision pair start to be in contact.
\note Only takes effect if the colliding actors are rigid bodies.
@@ -744,7 +741,7 @@ declare namespace phy {
/**
\brief Call contact report callback while this collision pair is in contact
If none of the two collision objects is a trigger shape then the contact report callback will get
If none of the two collision objects is a trigger shape then the contact report callback will get
called while the actors of this collision pair are in contact.
\note Triggers do not support this event. Persistent trigger contacts need to be tracked separately by observing eNOTIFY_TOUCH_FOUND/eNOTIFY_TOUCH_LOST events.
@@ -764,9 +761,9 @@ declare namespace phy {
/**
\brief Call contact report callback or trigger callback when this collision pair stops to be in contact
If one of the two collision objects is a trigger shape (see #PxShapeFlag::eTRIGGER_SHAPE)
then the trigger callback will get called as soon as the other object leaves the trigger volume.
If none of the two collision objects is a trigger shape then the contact report callback will get
If one of the two collision objects is a trigger shape (see #PxShapeFlag::eTRIGGER_SHAPE)
then the trigger callback will get called as soon as the other object leaves the trigger volume.
If none of the two collision objects is a trigger shape then the contact report callback will get
called when the actors of this collision pair stop to be in contact.
\note Only takes effect if the colliding actors are rigid bodies.
@@ -785,7 +782,7 @@ declare namespace phy {
If CCD with multiple passes is enabled, then a fast moving object might bounce on and off the same
object multiple times. Hence, the same pair might be in contact multiple times during a simulation step.
This flag will make sure that all the detected collision during CCD will get reported. For performance
reasons, the system can not always tell whether the contact pair lost touch in one of the previous CCD
reasons, the system can not always tell whether the contact pair lost touch in one of the previous CCD
passes and thus can also not always tell whether the contact is new or has persisted. eNOTIFY_TOUCH_CCD
just reports when the two collision objects were detected as being in contact during a CCD pass.
@@ -850,19 +847,19 @@ declare namespace phy {
eNOTIFY_CONTACT_POINTS = (1 << 9),
/**
\brief This flag is used to indicate whether this pair generates discrete collision detection contacts.
\brief This flag is used to indicate whether this pair generates discrete collision detection contacts.
\note Contacts are only responded to if eSOLVE_CONTACT is enabled.
*/
eDETECT_DISCRETE_CONTACT = (1 << 10),
/**
\brief This flag is used to indicate whether this pair generates CCD contacts.
\brief This flag is used to indicate whether this pair generates CCD contacts.
\note The contacts will only be responded to if eSOLVE_CONTACT is enabled on this pair.
\note The scene must have PxSceneFlag::eENABLE_CCD enabled to use this feature.
\note Non-static bodies of the pair should have PxRigidBodyFlag::eENABLE_CCD specified for this feature to work correctly.
\note This flag is not supported with trigger shapes. However, CCD trigger events can be emulated using non-trigger shapes
\note This flag is not supported with trigger shapes. However, CCD trigger events can be emulated using non-trigger shapes
and requesting eNOTIFY_TOUCH_FOUND and eNOTIFY_TOUCH_LOST and not raising eSOLVE_CONTACT on the pair.
@see PxRigidBodyFlag::eENABLE_CCD
@@ -872,40 +869,40 @@ declare namespace phy {
/**
\brief Provide pre solver velocities in contact reports for this collision pair.
If the collision pair has contact reports enabled, the velocities of the rigid bodies before contacts have been solved
will be provided in the contact report callback unless the pair lost touch in which case no data will be provided.
\note Usually it is not necessary to request these velocities as they will be available by querying the velocity from the provided
PxRigidActor object directly. However, it might be the case that the velocity of a rigid body gets set while the simulation is running
in which case the PxRigidActor would return this new velocity in the contact report callback and not the velocity the simulation used.
@see PxSimulationEventCallback.onContact(), PxContactPairVelocity, PxContactPairHeader.extraDataStream
*/
ePRE_SOLVER_VELOCITY = (1 << 12),
/**
\brief Provide post solver velocities in contact reports for this collision pair.
If the collision pair has contact reports enabled, the velocities of the rigid bodies after contacts have been solved
will be provided in the contact report callback unless the pair lost touch in which case no data will be provided.
@see PxSimulationEventCallback.onContact(), PxContactPairVelocity, PxContactPairHeader.extraDataStream
*/
ePOST_SOLVER_VELOCITY = (1 << 13),
/**
\brief Provide rigid body poses in contact reports for this collision pair.
If the collision pair has contact reports enabled, the rigid body poses at the contact event will be provided
If the collision pair has contact reports enabled, the rigid body poses at the contact event will be provided
in the contact report callback unless the pair lost touch in which case no data will be provided.
\note Usually it is not necessary to request these poses as they will be available by querying the pose from the provided
PxRigidActor object directly. However, it might be the case that the pose of a rigid body gets set while the simulation is running
in which case the PxRigidActor would return this new pose in the contact report callback and not the pose the simulation used.
Another use case is related to CCD with multiple passes enabled, A fast moving object might bounce on and off the same
Another use case is related to CCD with multiple passes enabled, A fast moving object might bounce on and off the same
object multiple times. This flag can be used to request the rigid body poses at the time of impact for each such collision event.
@see PxSimulationEventCallback.onContact(), PxContactPairPose, PxContactPairHeader.extraDataStream
*/
eCONTACT_EVENT_POSE = (1 << 14),
@@ -942,36 +939,40 @@ declare namespace phy {
*/
eRIGID_DYNAMIC,
eARTICULATION_LINK
}
enum ActorFlag {
/**
/**
\brief Disables scene gravity for this actor
*/
\brief Enable debug renderer for this actor
@see PxScene.getRenderBuffer() PxRenderBuffer PxVisualizationParameter
*/
eVISUALIZATION = (1 << 0),
/**
\brief Disables scene gravity for this actor
*/
eDISABLE_GRAVITY = (1 << 1),
/**
\brief Enables the sending of SimulationEventCallback::onWake() and SimulationEventCallback::onSleep() notify events
@see SimulationEventCallback::onWake() SimulationEventCallback::onSleep()
*/
eSEND_SLEEP_NOTIFIES = (1 << 2),
/**
\brief Disables simulation for the actor.
\note This is only supported by RigidStatic and RigidDynamic actors and can be used to reduce the memory footprint when rigid actors are
used for scene queries only.
\note Setting this flag will remove all constraints attached to the actor from the scene.
\note If this flag is set, the following calls are forbidden:
\li RigidBody: setLinearVelocity(), setAngularVelocity(), addForce(), addTorque(), clearForce(), clearTorque()
\li RigidDynamic: setKinematicTarget(), setWakeCounter(), wakeUp(), putToSleep()
\par <b>Sleeping:</b>
Raising this flag will set all velocities and the wake counter to 0, clear all forces, clear the kinematic target, put the actor
to sleep and wake up all touching actors from the previous frame.
@@ -984,9 +985,9 @@ declare namespace phy {
/**
\brief Enables kinematic mode for the actor.
Kinematic actors are special dynamic actors that are not
Kinematic actors are special dynamic actors that are not
influenced by forces (such as gravity), and have no momentum. They are considered to have infinite
mass and can be moved around the world using the setKinematicTarget() method. They will push
mass and can be moved around the world using the setKinematicTarget() method. They will push
regular dynamic actors out of the way. Kinematics will not collide with static or other kinematic objects.
Kinematic actors are great for moving platforms or characters, where direct motion control is desired.
@@ -1008,7 +1009,7 @@ declare namespace phy {
\brief Use the kinematic target transform for scene queries.
If this flag is raised, then scene queries will treat the kinematic target transform as the current pose
of the body (instead of using the actual pose). Without this flag, the kinematic target will only take
of the body (instead of using the actual pose). Without this flag, the kinematic target will only take
effect with respect to scene queries after a simulation step.
@see RigidDynamic.setKinematicTarget()
@@ -1018,9 +1019,9 @@ declare namespace phy {
/**
\brief Enables swept integration for the actor.
If this flag is raised and CCD is enabled on the scene, then this body will be simulated by the CCD system to ensure that collisions are not missed due to
high-speed motion. Note individual shape pairs still need to enable PairFlag::eDETECT_CCD_CONTACT in the collision filtering to enable the CCD to respond to
individual interactions.
If this flag is raised and CCD is enabled on the scene, then this body will be simulated by the CCD system to ensure that collisions are not missed due to
high-speed motion. Note individual shape pairs still need to enable PairFlag::eDETECT_CCD_CONTACT in the collision filtering to enable the CCD to respond to
individual interactions.
\note kinematic actors are incompatible with CCD so this flag will be cleared automatically when raised on a kinematic actor
@@ -1030,8 +1031,8 @@ declare namespace phy {
/**
\brief Enabled CCD in swept integration for the actor.
If this flag is raised and CCD is enabled, CCD interactions will simulate friction. By default, friction is disabled in CCD interactions because
CCD friction has been observed to introduce some simulation artifacts. CCD friction was enabled in previous versions of the SDK. Raising this flag will result in behavior
If this flag is raised and CCD is enabled, CCD interactions will simulate friction. By default, friction is disabled in CCD interactions because
CCD friction has been observed to introduce some simulation artifacts. CCD friction was enabled in previous versions of the SDK. Raising this flag will result in behavior
that is a closer match for previous versions of the SDK.
\note This flag requires RigidBodyFlag::eENABLE_CCD to be raised to have any effect.
@@ -1107,9 +1108,9 @@ declare namespace phy {
eACCELERATION2 = 512, //!< a group of acceleration drive constraints with the same stiffness and drive parameters
eACCELERATION3 = 768, //!< a group of acceleration drive constraints with the same stiffness and drive parameters
eROTATIONAL_EQUALITY = 1024, //!< rotational equality constraints with no force limit and no velocity target
eROTATIONAL_INEQUALITY = 1025, //!< rotational inequality constraints with (0, PX_MAX_FLT) force limits
eROTATIONAL_INEQUALITY = 1025, //!< rotational inequality constraints with (0, PX_MAX_FLT) force limits
eEQUALITY = 2048, //!< equality constraints with no force limit and no velocity target
eINEQUALITY = 2049 //!< inequality constraints with (0, PX_MAX_FLT) force limits
eINEQUALITY = 2049 //!< inequality constraints with (0, PX_MAX_FLT) force limits
}
enum ConvexFlag {
@@ -1123,20 +1124,20 @@ declare namespace phy {
/**
Automatically recomputes the hull from the vertices. If this flag is not set, you must provide the entire geometry manually.
\note There are two different algorithms for hull computation, please see PxConvexMeshCookingType.
\note There are two different algorithms for hull computation, please see PxConvexMeshCookingType.
@see PxConvexMeshCookingType
*/
eCOMPUTE_CONVEX = (1 << 1),
/**
\brief Checks and removes almost zero-area triangles during convex hull computation.
\brief Checks and removes almost zero-area triangles during convex hull computation.
The rejected area size is specified in PxCookingParams::areaTestEpsilon
\note This flag is only used in combination with eCOMPUTE_CONVEX.
\note If this flag is used in combination with eINFLATE_CONVEX, the newly added triangles
by the inflation algorithm are not checked (size of the triangles depends on PxCooking::skinWidth).
\note If this flag is used in combination with eINFLATE_CONVEX, the newly added triangles
by the inflation algorithm are not checked (size of the triangles depends on PxCooking::skinWidth).
@see PxCookingParams PxCookingParams::areaTestEpsilon
*/
@@ -1146,10 +1147,8 @@ declare namespace phy {
\brief Inflates the convex points according to skin width.
\note eINFLATE_CONVEX flag has been deprecated. The flag is automatically used when
PxConvexMeshCookingType::eINFLATION_INCREMENTAL_HULL is set. The default algorithm
PxConvexMeshCookingType::eQUICK_HULL ignores this flag, inflation is not used.
PxConvexMeshCookingType::eINFLATION_INCREMENTAL_HULL is set. The default algorithm
PxConvexMeshCookingType::eQUICK_HULL ignores this flag, inflation is not used.
/**
\brief Quantizes the input vertices using the k-means clustering
@@ -1163,7 +1162,7 @@ declare namespace phy {
/**
\brief Disables the convex mesh validation to speed-up hull creation. Please use separate validation
function in checked/debug builds. Creating a convex mesh with invalid input data without prior validation
may result in undefined behavior.
may result in undefined behavior.
@see PxCooking::validateConvexMesh
*/
@@ -1172,32 +1171,31 @@ declare namespace phy {
/**
\brief Enables plane shifting vertex limit algorithm.
Plane shifting is an alternative algorithm for the case when the computed hull has more vertices
Plane shifting is an alternative algorithm for the case when the computed hull has more vertices
than the specified vertex limit.
The default algorithm computes the full hull, and an OBB around the input vertices. This OBB is then sliced
with the hull planes until the vertex limit is reached.The default algorithm requires the vertex limit
to be set to at least 8, and typically produces results that are much better quality than are produced
with the hull planes until the vertex limit is reached.The default algorithm requires the vertex limit
to be set to at least 8, and typically produces results that are much better quality than are produced
by plane shifting.
When plane shifting is enabled, the hull computation stops when vertex limit is reached. The hull planes
are then shifted to contain all input vertices, and the new plane intersection points are then used to
generate the final hull with the given vertex limit.Plane shifting may produce sharp edges to vertices
are then shifted to contain all input vertices, and the new plane intersection points are then used to
generate the final hull with the given vertex limit.Plane shifting may produce sharp edges to vertices
very far away from the input cloud, and does not guarantee that all input vertices are inside the resulting
hull.However, it can be used with a vertex limit as low as 4.
*/
ePLANE_SHIFTING = (1 << 6),
/**
\brief Inertia tensor computation is faster using SIMD code, but the precision is lower, which may result
\brief Inertia tensor computation is faster using SIMD code, but the precision is lower, which may result
in incorrect inertia for very thin hulls.
*/
eFAST_INERTIA_COMPUTATION = (1 << 7),
/**
\brief Convex hull input vertices are shifted to be around origin to provide better computation stability.
It is recommended to provide input vertices around the origin, otherwise use this flag to improve
It is recommended to provide input vertices around the origin, otherwise use this flag to improve
numerical stability.
\note Is used only with eCOMPUTE_CONVEX flag.
*/
@@ -1222,9 +1220,9 @@ declare namespace phy {
/**
\brief When set, mesh cleaning is disabled. This makes cooking faster.
When clean mesh is not performed, mesh welding is also not performed.
When clean mesh is not performed, mesh welding is also not performed.
It is recommended to use only meshes that passed during validateTriangleMesh.
It is recommended to use only meshes that passed during validateTriangleMesh.
*/
eDISABLE_CLEAN_MESH = 1 << 1,
@@ -1351,7 +1349,6 @@ declare namespace phy {
*/
eARTICULATION = 4,
}
enum FilterObjectFlag {
@@ -1375,10 +1372,10 @@ declare namespace phy {
enum HeightFieldFormat {
/**
\brief Height field height data is 16 bit signed integers, followed by triangle materials.
\brief Height field height data is 16 bit signed integers, followed by triangle materials.
Each sample is 32 bits wide arranged as follows:
\image html heightFieldFormat_S16_TM.png
1) First there is a 16 bit height value.
@@ -1386,8 +1383,8 @@ declare namespace phy {
(so the material index is only 7 bits).
The high bit of material0 is the tess-flag.
The high bit of material1 is reserved for future use.
There are zero or more unused bytes before the next sample depending on HeightFieldDesc.sampleStride,
There are zero or more unused bytes before the next sample depending on HeightFieldDesc.sampleStride,
where the application may eventually keep its own data.
This is the only format supported at the moment.
@@ -1400,8 +1397,8 @@ declare namespace phy {
enum HeightFieldFlag {
/**
\brief Disable collisions with height field with boundary edges.
Raise this flag if several terrain patches are going to be placed adjacent to each other,
Raise this flag if several terrain patches are going to be placed adjacent to each other,
to avoid a bump when sliding across.
This flag is ignored in contact generation with sphere and capsule shapes.
@@ -1436,7 +1433,7 @@ declare namespace phy {
}
enum D6JointDriveFlag {
eACCELERATION = 1 //!< drive spring is for the acceleration at the joint (rather than the force)
eACCELERATION = 1 //!< drive spring is for the acceleration at the joint (rather than the force)
}
enum JointActorIndex {
@@ -1472,7 +1469,7 @@ declare namespace phy {
hold objects in place (or slow them down) and this is handled in the solver. But since the
solver is only an approximation, the result of the friction calculation can include a small
"error" - e.g. a box resting on a slope should not move at all if the static friction is in
action, but could slowly glide down the slope because of a small friction error in each
action, but could slowly glide down the slope because of a small friction error in each
simulation step. The strong friction counter-acts this by remembering the small error and
taking it to account during the next simulation step.
@@ -1526,10 +1523,10 @@ declare namespace phy {
/**
\brief Enables a simplified swept integration strategy, which sacrifices some accuracy for improved performance.
This simplified swept integration approach makes certain assumptions about the motion of objects that are not made when using a full swept integration.
This simplified swept integration approach makes certain assumptions about the motion of objects that are not made when using a full swept integration.
These assumptions usually hold but there are cases where they could result in incorrect behavior between a set of fast-moving rigid bodies. A key issue is that
fast-moving dynamic objects may tunnel through each-other after a rebound. This will not happen if this mode is disabled. However, this approach will be potentially
faster than a full swept integration because it will perform significantly fewer sweeps in non-trivial scenes involving many fast-moving objects. This approach
fast-moving dynamic objects may tunnel through each-other after a rebound. This will not happen if this mode is disabled. However, this approach will be potentially
faster than a full swept integration because it will perform significantly fewer sweeps in non-trivial scenes involving many fast-moving objects. This approach
should successfully resist objects passing through the static environment.
PairFlag::eDETECT_CCD_CONTACT requires this flag to be specified.
@@ -1545,8 +1542,8 @@ declare namespace phy {
eDISABLE_CCD_RESWEEP = (1 << 3),
/**
\brief Enable adaptive forces to accelerate convergence of the solver.
\brief Enable adaptive forces to accelerate convergence of the solver.
\note This flag is not mutable, and must be set in SceneDesc at scene creation.
<b>Default:</b> false
@@ -1555,7 +1552,7 @@ declare namespace phy {
/**
\brief Enable GJK-based distance collision detection system.
\note This flag is not mutable, and must be set in SceneDesc at scene creation.
<b>Default:</b> true
@@ -1563,18 +1560,18 @@ declare namespace phy {
eENABLE_PCM = (1 << 9),
/**
\brief Disable contact report buffer resize. Once the contact buffer is full, the rest of the contact reports will
\brief Disable contact report buffer resize. Once the contact buffer is full, the rest of the contact reports will
not be buffered and sent.
\note This flag is not mutable, and must be set in SceneDesc at scene creation.
<b>Default:</b> false
*/
eDISABLE_CONTACT_REPORT_BUFFER_RESIZE = (1 << 10),
/**
\brief Disable contact cache.
Contact caches are used internally to provide faster contact generation. You can disable all contact caches
if memory usage for this feature becomes too high.
@@ -1589,14 +1586,14 @@ declare namespace phy {
When set to true this requires that threads accessing the Scene use the
multi-threaded lock methods.
\note This flag is not mutable, and must be set in SceneDesc at scene creation.
@see Scene::lockRead
@see Scene::unlockRead
@see Scene::lockWrite
@see Scene::unlockWrite
<b>Default:</b> false
*/
eREQUIRE_RW_LOCK = (1 << 12),
@@ -1635,12 +1632,12 @@ declare namespace phy {
eEXCLUDE_KINEMATICS_FROM_ACTIVE_ACTORS = (1 << 17),
/**
\brief Provides improved determinism at the expense of performance.
\brief Provides improved determinism at the expense of performance.
By default, we provides limited determinism guarantees. Specifically, we guarantees that the exact scene (same actors created in the same order) and simulated using the same
By default, we provides limited determinism guarantees. Specifically, we guarantees that the exact scene (same actors created in the same order) and simulated using the same
time-stepping scheme should provide the exact same behaviour.
However, if additional actors are added to the simulation, this can affect the behaviour of the existing actors in the simulation, even if the set of new actors do not interact with
However, if additional actors are added to the simulation, this can affect the behaviour of the existing actors in the simulation, even if the set of new actors do not interact with
the existing actors.
This flag provides an additional level of determinism that guarantees that the simulation will not change if additional actors are added to the simulation, provided those actors do not interfere
@@ -1675,14 +1672,14 @@ declare namespace phy {
enum ShapeFlag {
/**
\brief The shape will partake in collision in the physical simulation.
\note It is illegal to raise the eSIMULATION_SHAPE and eTRIGGER_SHAPE flags.
In the event that one of these flags is already raised the sdk will reject any
attempt to raise the other. To raise the eSIMULATION_SHAPE first ensure that
In the event that one of these flags is already raised the sdk will reject any
attempt to raise the other. To raise the eSIMULATION_SHAPE first ensure that
eTRIGGER_SHAPE is already lowered.
\note This flag has no effect if simulation is disabled for the corresponding actor (see #ActorFlag::eDISABLE_SIMULATION).
@see SimulationEventCallback.onContact() Scene.setSimulationEventCallback() Shape.setFlag(), Shape.setFlags()
*/
eSIMULATION_SHAPE = (1 << 0),
@@ -1694,20 +1691,20 @@ declare namespace phy {
/**
\brief The shape is a trigger which can send reports whenever other shapes enter/leave its volume.
\note Triangle meshes and heightfields can not be triggers. Shape creation will fail in these cases.
\note Shapes marked as triggers do not collide with other objects. If an object should act both
as a trigger shape and a collision shape then create a rigid body with two shapes, one being a
trigger shape and the other a collision shape. It is illegal to raise the eTRIGGER_SHAPE and
eSIMULATION_SHAPE flags on a single Shape instance. In the event that one of these flags is already
raised the sdk will reject any attempt to raise the other. To raise the eTRIGGER_SHAPE flag first
as a trigger shape and a collision shape then create a rigid body with two shapes, one being a
trigger shape and the other a collision shape. It is illegal to raise the eTRIGGER_SHAPE and
eSIMULATION_SHAPE flags on a single Shape instance. In the event that one of these flags is already
raised the sdk will reject any attempt to raise the other. To raise the eTRIGGER_SHAPE flag first
ensure that eSIMULATION_SHAPE flag is already lowered.
\note Shapes marked as triggers are allowed to participate in scene queries, provided the eSCENE_QUERY_SHAPE flag is set.
\note Shapes marked as triggers are allowed to participate in scene queries, provided the eSCENE_QUERY_SHAPE flag is set.
\note This flag has no effect if simulation is disabled for the corresponding actor (see #ActorFlag::eDISABLE_SIMULATION).
@see SimulationEventCallback.onTrigger() Scene.setSimulationEventCallback() Shape.setFlag(), Shape.setFlags()
*/
eTRIGGER_SHAPE = (1 << 2),
@@ -1736,4 +1733,4 @@ declare namespace phy {
e16_BIT_INDICES = (1 << 1) //!< Denotes the use of 16-bit vertex indices
}
}
}
File diff suppressed because one or more lines are too long
Binary file not shown.
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
Binary file not shown.
File diff suppressed because one or more lines are too long
Binary file not shown.
Binary file not shown.
Regular → Executable
+67 -136
View File
@@ -1,137 +1,68 @@
var Module = (function() {
var _scriptDir = typeof document !== 'undefined' && document.currentScript ? document.currentScript.src : undefined;
return (
function(Module) {
Module = Module || {};
var c;c||(c=typeof Module !== 'undefined' ? Module : {});
c.compileGLSLZeroCopy=function(a,b,d,e){d=!!d;switch(b){case "vertex":var g=0;break;case "fragment":g=4;break;case "compute":g=5;break;default:throw Error("shader_stage must be 'vertex', 'fragment', or 'compute'.");}switch(e||"1.0"){case "1.0":var f=65536;break;case "1.1":f=65792;break;case "1.2":f=66048;break;case "1.3":f=66304;break;case "1.4":f=66560;break;case "1.5":f=66816;break;default:throw Error("spirv_version must be '1.0' ~ '1.5'.");}e=c._malloc(4);b=c._malloc(4);var h=aa([a,g,d,f,e,b]);
d=k(e);a=k(b);c._free(e);c._free(b);if(0===h)throw Error("GLSL compilation failed");e={};d/=4;e.data=c.HEAPU32.subarray(d,d+a);e.free=function(){c._destroy_output_buffer(h)};return e};c.compileGLSL=function(a,b,d,e){a=c.compileGLSLZeroCopy(a,b,d,e);b=a.data.slice();a.free();return b};var p={},q;for(q in c)c.hasOwnProperty(q)&&(p[q]=c[q]);var r="./this.program",t=!1,u=!1;t="object"===typeof window;u="function"===typeof importScripts;var v="",w;
if(t||u)u?v=self.location.href:document.currentScript&&(v=document.currentScript.src),_scriptDir&&(v=_scriptDir),0!==v.indexOf("blob:")?v=v.substr(0,v.lastIndexOf("/")+1):v="",u&&(w=function(a){var b=new XMLHttpRequest;b.open("GET",a,!1);b.responseType="arraybuffer";b.send(null);return new Uint8Array(b.response)});var x=c.print||console.log.bind(console),y=c.printErr||console.warn.bind(console);for(q in p)p.hasOwnProperty(q)&&(c[q]=p[q]);p=null;c.thisProgram&&(r=c.thisProgram);var A;
c.wasmBinary&&(A=c.wasmBinary);"object"!==typeof WebAssembly&&y("no native wasm support detected");function k(a){var b="i32";"*"===b.charAt(b.length-1)&&(b="i32");switch(b){case "i1":return B[a>>0];case "i8":return B[a>>0];case "i16":return ba[a>>1];case "i32":return C[a>>2];case "i64":return C[a>>2];case "float":return ca[a>>2];case "double":return da[a>>3];default:D("invalid type for getValue: "+b)}return null}var E,ea=new WebAssembly.Table({initial:859,maximum:859,element:"anyfunc"}),fa=!1;
function ha(){var a=c._convert_glsl_to_spirv;a||D("Assertion failed: Cannot call unknown function convert_glsl_to_spirv, make sure it is exported");return a}
function aa(a){var b="string number boolean number number number".split(" "),d={string:function(a){var b=0;if(null!==a&&void 0!==a&&0!==a){var d=(a.length<<2)+1;b=G(d);ia(a,H,b,d)}return b},array:function(a){var b=G(a.length);B.set(a,b);return b}},e=ha(),g=[],f=0;if(a)for(var h=0;h<a.length;h++){var n=d[b[h]];n?(0===f&&(f=ja()),g[h]=n(a[h])):g[h]=a[h]}a=e.apply(null,g);0!==f&&ka(f);return a}var la="undefined"!==typeof TextDecoder?new TextDecoder("utf8"):void 0;
function I(a,b,d){var e=b+d;for(d=b;a[d]&&!(d>=e);)++d;if(16<d-b&&a.subarray&&la)return la.decode(a.subarray(b,d));for(e="";b<d;){var g=a[b++];if(g&128){var f=a[b++]&63;if(192==(g&224))e+=String.fromCharCode((g&31)<<6|f);else{var h=a[b++]&63;g=224==(g&240)?(g&15)<<12|f<<6|h:(g&7)<<18|f<<12|h<<6|a[b++]&63;65536>g?e+=String.fromCharCode(g):(g-=65536,e+=String.fromCharCode(55296|g>>10,56320|g&1023))}}else e+=String.fromCharCode(g)}return e}
function ia(a,b,d,e){if(0<e){e=d+e-1;for(var g=0;g<a.length;++g){var f=a.charCodeAt(g);if(55296<=f&&57343>=f){var h=a.charCodeAt(++g);f=65536+((f&1023)<<10)|h&1023}if(127>=f){if(d>=e)break;b[d++]=f}else{if(2047>=f){if(d+1>=e)break;b[d++]=192|f>>6}else{if(65535>=f){if(d+2>=e)break;b[d++]=224|f>>12}else{if(d+3>=e)break;b[d++]=240|f>>18;b[d++]=128|f>>12&63}b[d++]=128|f>>6&63}b[d++]=128|f&63}}b[d]=0}}"undefined"!==typeof TextDecoder&&new TextDecoder("utf-16le");var J,B,H,ba,C,ca,da;
function ma(a){J=a;c.HEAP8=B=new Int8Array(a);c.HEAP16=ba=new Int16Array(a);c.HEAP32=C=new Int32Array(a);c.HEAPU8=H=new Uint8Array(a);c.HEAPU16=new Uint16Array(a);c.HEAPU32=new Uint32Array(a);c.HEAPF32=ca=new Float32Array(a);c.HEAPF64=da=new Float64Array(a)}var na=c.TOTAL_MEMORY||16777216;c.wasmMemory?E=c.wasmMemory:E=new WebAssembly.Memory({initial:na/65536});E&&(J=E.buffer);na=J.byteLength;ma(J);C[84916]=5582704;
function K(a){for(;0<a.length;){var b=a.shift();if("function"==typeof b)b();else{var d=b.J;"number"===typeof d?void 0===b.H?c.dynCall_v(d):c.dynCall_vi(d,b.H):d(void 0===b.H?null:b.H)}}}var oa=[],pa=[],qa=[],ra=[];function sa(){var a=c.preRun.shift();oa.unshift(a)}var L=0,M=null,N=null;c.preloadedImages={};c.preloadedAudios={};function D(a){if(c.onAbort)c.onAbort(a);x(a);y(a);fa=!0;throw new WebAssembly.RuntimeError("abort("+a+"). Build with -s ASSERTIONS=1 for more info.");}
function ta(){var a=O;return String.prototype.startsWith?a.startsWith("data:application/octet-stream;base64,"):0===a.indexOf("data:application/octet-stream;base64,")}var O="glslang.wasm";if(!ta()){var ua=O;O=c.locateFile?c.locateFile(ua,v):v+ua}function wa(){try{if(A)return new Uint8Array(A);if(w)return w(O);throw"both async and sync fetching of the wasm failed";}catch(a){D(a)}}
function xa(){return A||!t&&!u||"function"!==typeof fetch?new Promise(function(a){a(wa())}):fetch(O,{credentials:"same-origin"}).then(function(a){if(!a.ok)throw"failed to load wasm binary file at '"+O+"'";return a.arrayBuffer()}).catch(function(){return wa()})}pa.push({J:function(){ya()}});var za=[null,[],[]],P=0;function Aa(){P+=4;return C[P-4>>2]}var Q={},Ba={};
function Ca(){if(!R){var a={USER:"web_user",LOGNAME:"web_user",PATH:"/",PWD:"/",HOME:"/home/web_user",LANG:("object"===typeof navigator&&navigator.languages&&navigator.languages[0]||"C").replace("-","_")+".UTF-8",_:r},b;for(b in Ba)a[b]=Ba[b];var d=[];for(b in a)d.push(b+"="+a[b]);R=d}return R}var R;function S(a){return 0===a%4&&(0!==a%100||0===a%400)}function T(a,b){for(var d=0,e=0;e<=b;d+=a[e++]);return d}var U=[31,29,31,30,31,30,31,31,30,31,30,31],W=[31,28,31,30,31,30,31,31,30,31,30,31];
function X(a,b){for(a=new Date(a.getTime());0<b;){var d=a.getMonth(),e=(S(a.getFullYear())?U:W)[d];if(b>e-a.getDate())b-=e-a.getDate()+1,a.setDate(1),11>d?a.setMonth(d+1):(a.setMonth(0),a.setFullYear(a.getFullYear()+1));else{a.setDate(a.getDate()+b);break}}return a}
function Da(a,b,d,e){function g(a,b,d){for(a="number"===typeof a?a.toString():a||"";a.length<b;)a=d[0]+a;return a}function f(a,b){return g(a,b,"0")}function h(a,b){function V(a){return 0>a?-1:0<a?1:0}var d;0===(d=V(a.getFullYear()-b.getFullYear()))&&0===(d=V(a.getMonth()-b.getMonth()))&&(d=V(a.getDate()-b.getDate()));return d}function n(a){switch(a.getDay()){case 0:return new Date(a.getFullYear()-1,11,29);case 1:return a;case 2:return new Date(a.getFullYear(),0,3);case 3:return new Date(a.getFullYear(),
0,2);case 4:return new Date(a.getFullYear(),0,1);case 5:return new Date(a.getFullYear()-1,11,31);case 6:return new Date(a.getFullYear()-1,11,30)}}function z(a){a=X(new Date(a.A+1900,0,1),a.G);var b=n(new Date(a.getFullYear()+1,0,4));return 0>=h(n(new Date(a.getFullYear(),0,4)),a)?0>=h(b,a)?a.getFullYear()+1:a.getFullYear():a.getFullYear()-1}var m=C[e+40>>2];e={N:C[e>>2],M:C[e+4>>2],D:C[e+8>>2],C:C[e+12>>2],B:C[e+16>>2],A:C[e+20>>2],F:C[e+24>>2],G:C[e+28>>2],X:C[e+32>>2],L:C[e+36>>2],O:m?m?I(H,m,void 0):
"":""};d=d?I(H,d,void 0):"";m={"%c":"%a %b %d %H:%M:%S %Y","%D":"%m/%d/%y","%F":"%Y-%m-%d","%h":"%b","%r":"%I:%M:%S %p","%R":"%H:%M","%T":"%H:%M:%S","%x":"%m/%d/%y","%X":"%H:%M:%S","%Ec":"%c","%EC":"%C","%Ex":"%m/%d/%y","%EX":"%H:%M:%S","%Ey":"%y","%EY":"%Y","%Od":"%d","%Oe":"%e","%OH":"%H","%OI":"%I","%Om":"%m","%OM":"%M","%OS":"%S","%Ou":"%u","%OU":"%U","%OV":"%V","%Ow":"%w","%OW":"%W","%Oy":"%y"};for(var l in m)d=d.replace(new RegExp(l,"g"),m[l]);var F="Sunday Monday Tuesday Wednesday Thursday Friday Saturday".split(" "),
va="January February March April May June July August September October November December".split(" ");m={"%a":function(a){return F[a.F].substring(0,3)},"%A":function(a){return F[a.F]},"%b":function(a){return va[a.B].substring(0,3)},"%B":function(a){return va[a.B]},"%C":function(a){return f((a.A+1900)/100|0,2)},"%d":function(a){return f(a.C,2)},"%e":function(a){return g(a.C,2," ")},"%g":function(a){return z(a).toString().substring(2)},"%G":function(a){return z(a)},"%H":function(a){return f(a.D,2)},
"%I":function(a){a=a.D;0==a?a=12:12<a&&(a-=12);return f(a,2)},"%j":function(a){return f(a.C+T(S(a.A+1900)?U:W,a.B-1),3)},"%m":function(a){return f(a.B+1,2)},"%M":function(a){return f(a.M,2)},"%n":function(){return"\n"},"%p":function(a){return 0<=a.D&&12>a.D?"AM":"PM"},"%S":function(a){return f(a.N,2)},"%t":function(){return"\t"},"%u":function(a){return a.F||7},"%U":function(a){var b=new Date(a.A+1900,0,1),d=0===b.getDay()?b:X(b,7-b.getDay());a=new Date(a.A+1900,a.B,a.C);return 0>h(d,a)?f(Math.ceil((31-
d.getDate()+(T(S(a.getFullYear())?U:W,a.getMonth()-1)-31)+a.getDate())/7),2):0===h(d,b)?"01":"00"},"%V":function(a){var b=n(new Date(a.A+1900,0,4)),d=n(new Date(a.A+1901,0,4)),e=X(new Date(a.A+1900,0,1),a.G);return 0>h(e,b)?"53":0>=h(d,e)?"01":f(Math.ceil((b.getFullYear()<a.A+1900?a.G+32-b.getDate():a.G+1-b.getDate())/7),2)},"%w":function(a){return a.F},"%W":function(a){var b=new Date(a.A,0,1),d=1===b.getDay()?b:X(b,0===b.getDay()?1:7-b.getDay()+1);a=new Date(a.A+1900,a.B,a.C);return 0>h(d,a)?f(Math.ceil((31-
d.getDate()+(T(S(a.getFullYear())?U:W,a.getMonth()-1)-31)+a.getDate())/7),2):0===h(d,b)?"01":"00"},"%y":function(a){return(a.A+1900).toString().substring(2)},"%Y":function(a){return a.A+1900},"%z":function(a){a=a.L;var b=0<=a;a=Math.abs(a)/60;return(b?"+":"-")+String("0000"+(a/60*100+a%60)).slice(-4)},"%Z":function(a){return a.O},"%%":function(){return"%"}};for(l in m)0<=d.indexOf(l)&&(d=d.replace(new RegExp(l,"g"),m[l](e)));l=Ea(d);if(l.length>b)return 0;B.set(l,a);return l.length-1}
function Ea(a){for(var b=0,d=0;d<a.length;++d){var e=a.charCodeAt(d);55296<=e&&57343>=e&&(e=65536+((e&1023)<<10)|a.charCodeAt(++d)&1023);127>=e?++b:b=2047>=e?b+2:65535>=e?b+3:b+4}b=Array(b+1);ia(a,b,0,b.length);return b}
var Ga={f:function(){},c:function(){c.___errno_location&&(C[c.___errno_location()>>2]=63);return-1},n:function(a,b){P=b;try{var d=Aa();var e=Aa();if(-1===d||0===e)var g=-28;else{var f=Q.K[d];if(f&&e===f.U){var h=(void 0).T(f.S);Q.R(d,h,e,f.flags,f.offset);(void 0).W(h);Q.K[d]=null;f.P&&Fa(f.V)}g=0}return g}catch(n){return D(n),-n.I}},a:function(){},b:function(){D()},k:function(a,b,d){H.set(H.subarray(b,b+d),a)},l:function(a){var b=B.length;if(2147418112<a)return!1;for(var d=1;4>=d;d*=2){var e=b*(1+
.2/d);e=Math.min(e,a+100663296);e=Math.max(16777216,a,e);0<e%65536&&(e+=65536-e%65536);a:{try{E.grow(Math.min(2147418112,e)-J.byteLength+65535>>16);ma(E.buffer);var g=1;break a}catch(f){}g=void 0}if(g)return!0}return!1},d:function(a,b){var d=0;Ca().forEach(function(e,g){var f=b+d;g=C[a+4*g>>2]=f;for(f=0;f<e.length;++f)B[g++>>0]=e.charCodeAt(f);B[g>>0]=0;d+=e.length+1});return 0},e:function(a,b){var d=Ca();C[a>>2]=d.length;var e=0;d.forEach(function(a){e+=a.length+1});C[b>>2]=e;return 0},h:function(){return 0},
j:function(){return 0},g:function(a,b,d,e){try{for(var g=0,f=0;f<d;f++){for(var h=C[b+8*f>>2],n=C[b+(8*f+4)>>2],z=0;z<n;z++){var m=H[h+z],l=za[a];0===m||10===m?((1===a?x:y)(I(l,0)),l.length=0):l.push(m)}g+=n}C[e>>2]=g;return 0}catch(F){return D(F),F.I}},memory:E,o:function(){},i:function(){},m:function(a,b,d,e){return Da(a,b,d,e)},table:ea},Ha=function(){function a(a){c.asm=a.exports;L--;c.monitorRunDependencies&&c.monitorRunDependencies(L);0==L&&(null!==M&&(clearInterval(M),M=null),N&&(a=N,N=null,
a()))}function b(b){a(b.instance)}function d(a){return xa().then(function(a){return WebAssembly.instantiate(a,e)}).then(a,function(a){y("failed to asynchronously prepare wasm: "+a);D(a)})}var e={env:Ga,wasi_snapshot_preview1:Ga};L++;c.monitorRunDependencies&&c.monitorRunDependencies(L);if(c.instantiateWasm)try{return c.instantiateWasm(e,a)}catch(g){return y("Module.instantiateWasm callback failed with error: "+g),!1}(function(){if(A||"function"!==typeof WebAssembly.instantiateStreaming||ta()||"function"!==
typeof fetch)return d(b);fetch(O,{credentials:"same-origin"}).then(function(a){return WebAssembly.instantiateStreaming(a,e).then(b,function(a){y("wasm streaming compile failed: "+a);y("falling back to ArrayBuffer instantiation");d(b)})})})();return{}}();c.asm=Ha;var ya=c.___wasm_call_ctors=function(){return(ya=c.___wasm_call_ctors=c.asm.p).apply(null,arguments)};c._convert_glsl_to_spirv=function(){return(c._convert_glsl_to_spirv=c.asm.q).apply(null,arguments)};
c._destroy_output_buffer=function(){return(c._destroy_output_buffer=c.asm.r).apply(null,arguments)};c._malloc=function(){return(c._malloc=c.asm.s).apply(null,arguments)};var Fa=c._free=function(){return(Fa=c._free=c.asm.t).apply(null,arguments)},ja=c.stackSave=function(){return(ja=c.stackSave=c.asm.u).apply(null,arguments)},G=c.stackAlloc=function(){return(G=c.stackAlloc=c.asm.v).apply(null,arguments)},ka=c.stackRestore=function(){return(ka=c.stackRestore=c.asm.w).apply(null,arguments)};
c.dynCall_vi=function(){return(c.dynCall_vi=c.asm.x).apply(null,arguments)};c.dynCall_v=function(){return(c.dynCall_v=c.asm.y).apply(null,arguments)};c.asm=Ha;var Y;c.then=function(a){if(Y)a(c);else{var b=c.onRuntimeInitialized;c.onRuntimeInitialized=function(){b&&b();a(c)}}return c};N=function Ia(){Y||Z();Y||(N=Ia)};
function Z(){function a(){if(!Y&&(Y=!0,!fa)){K(pa);K(qa);if(c.onRuntimeInitialized)c.onRuntimeInitialized();if(c.postRun)for("function"==typeof c.postRun&&(c.postRun=[c.postRun]);c.postRun.length;){var a=c.postRun.shift();ra.unshift(a)}K(ra)}}if(!(0<L)){if(c.preRun)for("function"==typeof c.preRun&&(c.preRun=[c.preRun]);c.preRun.length;)sa();K(oa);0<L||(c.setStatus?(c.setStatus("Running..."),setTimeout(function(){setTimeout(function(){c.setStatus("")},1);a()},1)):a())}}c.run=Z;
if(c.preInit)for("function"==typeof c.preInit&&(c.preInit=[c.preInit]);0<c.preInit.length;)c.preInit.pop()();Z();
return Module
}
);
})();
// if (typeof exports === 'object' && typeof module === 'object')
// module.exports = Module;
// else if (typeof define === 'function' && define['amd'])
// define([], function() { return Module; });
// else if (typeof exports === 'object')
// exports["Module"] = Module;
// export default (() => {
// const initialize = () => {
// return new Promise(resolve => {
// Module({
// locateFile() {
// const i = import.meta.url.lastIndexOf('/')
// return import.meta.url.substring(0, i) + '/glslang.wasm';
// },
// onRuntimeInitialized() {
// resolve({
// compileGLSLZeroCopy: this.compileGLSLZeroCopy,
// compileGLSL: this.compileGLSL,
// });
// },
// });
// });
// };
// let instance;
// return () => {
// if (!instance) {
// instance = initialize();
// }
// return instance;
// };
// })();
// (function tryToExport(root, factory) {
// if (typeof exports === 'object' && typeof module === 'object')
// module.exports = factory();
// else if (typeof define === 'function' && define.amd)
// define("glslang", [], factory);
// else if (typeof exports === 'object')
// exports["glslang"] = factory();
// else
// root["glslang"] = factory();
// })(typeof self !== "undefined" ? self : typeof global !== "undefined" ? global : this, () => {
// const initialize = (wasmPath) => {
// wasmPath = 'http://localhost:7456/glslang.wasm'
// return new Promise(resolve => {
// Module({
// locateFile() {
// return wasmPath;
// },
// onRuntimeInitialized() {
// resolve({
// compileGLSLZeroCopy: this.compileGLSLZeroCopy,
// compileGLSL: this.compileGLSL,
// });
// },
// });
// });
// };
// let instance;
// return (wasmPath) => {
// if (!instance) {
// instance = initialize(wasmPath);
// }
// return instance;
// };
// });
const initialize = (wasmPath) => {
return new Promise(resolve => {
Module({
locateFile() {
return wasmPath;
},
onRuntimeInitialized() {
resolve({
compileGLSLZeroCopy: this.compileGLSLZeroCopy,
compileGLSL: this.compileGLSL,
});
},
});
});
};
let instance;
export default (wasmPath) => {
if (!instance) {
instance = initialize(wasmPath);
}
return instance;
var Module = (() => {
var _scriptDir = typeof document !== 'undefined' && document.currentScript ? document.currentScript.src : undefined;
return (
function(Module) {
Module = Module || {};
var c;c||(c=typeof Module !== 'undefined' ? Module : {});var r,t;c.ready=new Promise(function(b,d){r=b;t=d});
c.compileGLSLZeroCopy=function(b,d,e,f){e=!!e;switch(d){case "vertex":var h=0;break;case "fragment":h=4;break;case "compute":h=5;break;default:throw Error("shader_stage must be 'vertex', 'fragment', or 'compute'.");}switch(f||"1.0"){case "1.0":var g=65536;break;case "1.1":g=65792;break;case "1.2":g=66048;break;case "1.3":g=66304;break;case "1.4":g=66560;break;case "1.5":g=66816;break;default:throw Error("spirv_version must be '1.0' ~ '1.5'.");}f=c._malloc(4);d=c._malloc(4);var m=aa([b,h,e,g,f,d]);
e=u(f);b=u(d);c._free(f);c._free(d);if(0===m)throw Error("GLSL compilation failed");f={};e/=4;f.data=c.HEAPU32.subarray(e,e+b);f.free=function(){c._destroy_output_buffer(m)};return f};c.compileGLSL=function(b,d,e,f){b=c.compileGLSLZeroCopy(b,d,e,f);d=b.data.slice();b.free();return d};var v=Object.assign({},c),x="./this.program",y="object"==typeof window,z="function"==typeof importScripts,B="",C;
if(y||z)z?B=self.location.href:"undefined"!=typeof document&&document.currentScript&&(B=document.currentScript.src),_scriptDir&&(B=_scriptDir),0!==B.indexOf("blob:")?B=B.substr(0,B.replace(/[?#].*/,"").lastIndexOf("/")+1):B="",z&&(C=b=>{var d=new XMLHttpRequest;d.open("GET",b,!1);d.responseType="arraybuffer";d.send(null);return new Uint8Array(d.response)});var ba=c.print||console.log.bind(console),D=c.printErr||console.warn.bind(console);Object.assign(c,v);v=null;c.thisProgram&&(x=c.thisProgram);
var E;c.wasmBinary&&(E=c.wasmBinary);var noExitRuntime=c.noExitRuntime||!0;"object"!=typeof WebAssembly&&F("no native wasm support detected");var G,H=!1,I="undefined"!=typeof TextDecoder?new TextDecoder("utf8"):void 0;
function J(b,d){for(var e=d+NaN,f=d;b[f]&&!(f>=e);)++f;if(16<f-d&&b.buffer&&I)return I.decode(b.subarray(d,f));for(e="";d<f;){var h=b[d++];if(h&128){var g=b[d++]&63;if(192==(h&224))e+=String.fromCharCode((h&31)<<6|g);else{var m=b[d++]&63;h=224==(h&240)?(h&15)<<12|g<<6|m:(h&7)<<18|g<<12|m<<6|b[d++]&63;65536>h?e+=String.fromCharCode(h):(h-=65536,e+=String.fromCharCode(55296|h>>10,56320|h&1023))}}else e+=String.fromCharCode(h)}return e}
function K(b,d,e,f){if(0<f){f=e+f-1;for(var h=0;h<b.length;++h){var g=b.charCodeAt(h);if(55296<=g&&57343>=g){var m=b.charCodeAt(++h);g=65536+((g&1023)<<10)|m&1023}if(127>=g){if(e>=f)break;d[e++]=g}else{if(2047>=g){if(e+1>=f)break;d[e++]=192|g>>6}else{if(65535>=g){if(e+2>=f)break;d[e++]=224|g>>12}else{if(e+3>=f)break;d[e++]=240|g>>18;d[e++]=128|g>>12&63}d[e++]=128|g>>6&63}d[e++]=128|g&63}}d[e]=0}}var L,M,N,ca,O,P,da,ea;
function fa(){var b=G.buffer;L=b;c.HEAP8=M=new Int8Array(b);c.HEAP16=ca=new Int16Array(b);c.HEAP32=O=new Int32Array(b);c.HEAPU8=N=new Uint8Array(b);c.HEAPU16=new Uint16Array(b);c.HEAPU32=P=new Uint32Array(b);c.HEAPF32=da=new Float32Array(b);c.HEAPF64=ea=new Float64Array(b)}var ha=[],ia=[],ja=[];function ka(){var b=c.preRun.shift();ha.unshift(b)}var Q=0,R=null,S=null;
function F(b){if(c.onAbort)c.onAbort(b);b="Aborted("+b+")";D(b);H=!0;b=new WebAssembly.RuntimeError(b+". Build with -sASSERTIONS for more info.");t(b);throw b;}function la(){return T.startsWith("data:application/octet-stream;base64,")}var T;T="glslang.wasm";if(!la()){var ma=T;T=c.locateFile?c.locateFile(ma,B):B+ma}function na(){var b=T;try{if(b==T&&E)return new Uint8Array(E);if(C)return C(b);throw"both async and sync fetching of the wasm failed";}catch(d){F(d)}}
function ra(){return E||!y&&!z||"function"!=typeof fetch?Promise.resolve().then(function(){return na()}):fetch(T,{credentials:"same-origin"}).then(function(b){if(!b.ok)throw"failed to load wasm binary file at '"+T+"'";return b.arrayBuffer()}).catch(function(){return na()})}function U(b){for(;0<b.length;)b.shift()(c)}
function u(b){var d="i32";d.endsWith("*")&&(d="*");switch(d){case "i1":return M[b>>0];case "i8":return M[b>>0];case "i16":return ca[b>>1];case "i32":return O[b>>2];case "i64":return O[b>>2];case "float":return da[b>>2];case "double":return ea[b>>3];case "*":return P[b>>2];default:F("invalid type for getValue: "+d)}return null}var V={};
function sa(){if(!W){var b={USER:"web_user",LOGNAME:"web_user",PATH:"/",PWD:"/",HOME:"/home/web_user",LANG:("object"==typeof navigator&&navigator.languages&&navigator.languages[0]||"C").replace("-","_")+".UTF-8",_:x||"./this.program"},d;for(d in V)void 0===V[d]?delete b[d]:b[d]=V[d];var e=[];for(d in b)e.push(d+"="+b[d]);W=e}return W}var W,ta=[null,[],[]];function X(b){return 0===b%4&&(0!==b%100||0===b%400)}var ua=[31,29,31,30,31,30,31,31,30,31,30,31],va=[31,28,31,30,31,30,31,31,30,31,30,31];
function wa(b){for(var d=0,e=0;e<b.length;++e){var f=b.charCodeAt(e);127>=f?d++:2047>=f?d+=2:55296<=f&&57343>=f?(d+=4,++e):d+=3}d=Array(d+1);K(b,d,0,d.length);return d}
function xa(b,d,e,f){function h(a,k,l){for(a="number"==typeof a?a.toString():a||"";a.length<k;)a=l[0]+a;return a}function g(a,k){return h(a,k,"0")}function m(a,k){function l(oa){return 0>oa?-1:0<oa?1:0}var A;0===(A=l(a.getFullYear()-k.getFullYear()))&&0===(A=l(a.getMonth()-k.getMonth()))&&(A=l(a.getDate()-k.getDate()));return A}function w(a){switch(a.getDay()){case 0:return new Date(a.getFullYear()-1,11,29);case 1:return a;case 2:return new Date(a.getFullYear(),0,3);case 3:return new Date(a.getFullYear(),
0,2);case 4:return new Date(a.getFullYear(),0,1);case 5:return new Date(a.getFullYear()-1,11,31);case 6:return new Date(a.getFullYear()-1,11,30)}}function p(a){var k=a.v;for(a=new Date((new Date(a.A+1900,0,1)).getTime());0<k;){var l=a.getMonth(),A=(X(a.getFullYear())?ua:va)[l];if(k>A-a.getDate())k-=A-a.getDate()+1,a.setDate(1),11>l?a.setMonth(l+1):(a.setMonth(0),a.setFullYear(a.getFullYear()+1));else{a.setDate(a.getDate()+k);break}}l=new Date(a.getFullYear()+1,0,4);k=w(new Date(a.getFullYear(),0,
4));l=w(l);return 0>=m(k,a)?0>=m(l,a)?a.getFullYear()+1:a.getFullYear():a.getFullYear()-1}var n=O[f+40>>2];f={H:O[f>>2],G:O[f+4>>2],B:O[f+8>>2],D:O[f+12>>2],C:O[f+16>>2],A:O[f+20>>2],u:O[f+24>>2],v:O[f+28>>2],J:O[f+32>>2],F:O[f+36>>2],I:n?n?J(N,n):"":""};e=e?J(N,e):"";n={"%c":"%a %b %d %H:%M:%S %Y","%D":"%m/%d/%y","%F":"%Y-%m-%d","%h":"%b","%r":"%I:%M:%S %p","%R":"%H:%M","%T":"%H:%M:%S","%x":"%m/%d/%y","%X":"%H:%M:%S","%Ec":"%c","%EC":"%C","%Ex":"%m/%d/%y","%EX":"%H:%M:%S","%Ey":"%y","%EY":"%Y","%Od":"%d",
"%Oe":"%e","%OH":"%H","%OI":"%I","%Om":"%m","%OM":"%M","%OS":"%S","%Ou":"%u","%OU":"%U","%OV":"%V","%Ow":"%w","%OW":"%W","%Oy":"%y"};for(var q in n)e=e.replace(new RegExp(q,"g"),n[q]);var pa="Sunday Monday Tuesday Wednesday Thursday Friday Saturday".split(" "),qa="January February March April May June July August September October November December".split(" ");n={"%a":function(a){return pa[a.u].substring(0,3)},"%A":function(a){return pa[a.u]},"%b":function(a){return qa[a.C].substring(0,3)},"%B":function(a){return qa[a.C]},
"%C":function(a){return g((a.A+1900)/100|0,2)},"%d":function(a){return g(a.D,2)},"%e":function(a){return h(a.D,2," ")},"%g":function(a){return p(a).toString().substring(2)},"%G":function(a){return p(a)},"%H":function(a){return g(a.B,2)},"%I":function(a){a=a.B;0==a?a=12:12<a&&(a-=12);return g(a,2)},"%j":function(a){for(var k=0,l=0;l<=a.C-1;k+=(X(a.A+1900)?ua:va)[l++]);return g(a.D+k,3)},"%m":function(a){return g(a.C+1,2)},"%M":function(a){return g(a.G,2)},"%n":function(){return"\n"},"%p":function(a){return 0<=
a.B&&12>a.B?"AM":"PM"},"%S":function(a){return g(a.H,2)},"%t":function(){return"\t"},"%u":function(a){return a.u||7},"%U":function(a){return g(Math.floor((a.v+7-a.u)/7),2)},"%V":function(a){var k=Math.floor((a.v+7-(a.u+6)%7)/7);2>=(a.u+371-a.v-2)%7&&k++;if(k)53==k&&(l=(a.u+371-a.v)%7,4==l||3==l&&X(a.A)||(k=1));else{k=52;var l=(a.u+7-a.v-1)%7;(4==l||5==l&&X(a.A%400-1))&&k++}return g(k,2)},"%w":function(a){return a.u},"%W":function(a){return g(Math.floor((a.v+7-(a.u+6)%7)/7),2)},"%y":function(a){return(a.A+
1900).toString().substring(2)},"%Y":function(a){return a.A+1900},"%z":function(a){a=a.F;var k=0<=a;a=Math.abs(a)/60;return(k?"+":"-")+String("0000"+(a/60*100+a%60)).slice(-4)},"%Z":function(a){return a.I},"%%":function(){return"%"}};e=e.replace(/%%/g,"\x00\x00");for(q in n)e.includes(q)&&(e=e.replace(new RegExp(q,"g"),n[q](f)));e=e.replace(/\0\0/g,"%");q=wa(e);if(q.length>d)return 0;M.set(q,b);return q.length-1}
function aa(b){var d="string number boolean number number number".split(" "),e={string:p=>{var n=0;if(null!==p&&void 0!==p&&0!==p){var q=(p.length<<2)+1;n=Y(q);K(p,N,n,q)}return n},array:p=>{var n=Y(p.length);M.set(p,n);return n}},f=c._convert_glsl_to_spirv,h=[],g=0;if(b)for(var m=0;m<b.length;m++){var w=e[d[m]];w?(0===g&&(g=ya()),h[m]=w(b[m])):h[m]=b[m]}b=f.apply(null,h);return b=function(p){0!==g&&za(g);return p}(b)}
var Aa={b:function(){F("")},i:function(b,d,e){N.copyWithin(b,d,d+e)},g:function(b){var d=N.length;b>>>=0;if(2147483648<b)return!1;for(var e=1;4>=e;e*=2){var f=d*(1+.2/e);f=Math.min(f,b+100663296);var h=Math;f=Math.max(b,f);h=h.min.call(h,2147483648,f+(65536-f%65536)%65536);a:{try{G.grow(h-L.byteLength+65535>>>16);fa();var g=1;break a}catch(m){}g=void 0}if(g)return!0}return!1},e:function(b,d){var e=0;sa().forEach(function(f,h){var g=d+e;h=P[b+4*h>>2]=g;for(g=0;g<f.length;++g)M[h++>>0]=f.charCodeAt(g);
M[h>>0]=0;e+=f.length+1});return 0},f:function(b,d){var e=sa();P[b>>2]=e.length;var f=0;e.forEach(function(h){f+=h.length+1});P[d>>2]=f;return 0},h:function(){return 52},c:function(){return 70},a:function(b,d,e,f){for(var h=0,g=0;g<e;g++){var m=P[d>>2],w=P[d+4>>2];d+=8;for(var p=0;p<w;p++){var n=N[m+p],q=ta[b];0===n||10===n?((1===b?ba:D)(J(q,0)),q.length=0):q.push(n)}h+=w}P[f>>2]=h;return 0},d:function(b,d,e,f){return xa(b,d,e,f)}};
(function(){function b(h){c.asm=h.exports;G=c.asm.j;fa();ia.unshift(c.asm.k);Q--;c.monitorRunDependencies&&c.monitorRunDependencies(Q);0==Q&&(null!==R&&(clearInterval(R),R=null),S&&(h=S,S=null,h()))}function d(h){b(h.instance)}function e(h){return ra().then(function(g){return WebAssembly.instantiate(g,f)}).then(function(g){return g}).then(h,function(g){D("failed to asynchronously prepare wasm: "+g);F(g)})}var f={a:Aa};Q++;c.monitorRunDependencies&&c.monitorRunDependencies(Q);if(c.instantiateWasm)try{return c.instantiateWasm(f,
b)}catch(h){return D("Module.instantiateWasm callback failed with error: "+h),!1}(function(){return E||"function"!=typeof WebAssembly.instantiateStreaming||la()||"function"!=typeof fetch?e(d):fetch(T,{credentials:"same-origin"}).then(function(h){return WebAssembly.instantiateStreaming(h,f).then(d,function(g){D("wasm streaming compile failed: "+g);D("falling back to ArrayBuffer instantiation");return e(d)})})})().catch(t);return{}})();
c.___wasm_call_ctors=function(){return(c.___wasm_call_ctors=c.asm.k).apply(null,arguments)};c._convert_glsl_to_spirv=function(){return(c._convert_glsl_to_spirv=c.asm.l).apply(null,arguments)};c._destroy_output_buffer=function(){return(c._destroy_output_buffer=c.asm.m).apply(null,arguments)};c._malloc=function(){return(c._malloc=c.asm.o).apply(null,arguments)};c._free=function(){return(c._free=c.asm.p).apply(null,arguments)};
var ya=c.stackSave=function(){return(ya=c.stackSave=c.asm.q).apply(null,arguments)},za=c.stackRestore=function(){return(za=c.stackRestore=c.asm.r).apply(null,arguments)},Y=c.stackAlloc=function(){return(Y=c.stackAlloc=c.asm.s).apply(null,arguments)},Z;S=function Ba(){Z||Ca();Z||(S=Ba)};
function Ca(){function b(){if(!Z&&(Z=!0,c.calledRun=!0,!H)){U(ia);r(c);if(c.onRuntimeInitialized)c.onRuntimeInitialized();if(c.postRun)for("function"==typeof c.postRun&&(c.postRun=[c.postRun]);c.postRun.length;){var d=c.postRun.shift();ja.unshift(d)}U(ja)}}if(!(0<Q)){if(c.preRun)for("function"==typeof c.preRun&&(c.preRun=[c.preRun]);c.preRun.length;)ka();U(ha);0<Q||(c.setStatus?(c.setStatus("Running..."),setTimeout(function(){setTimeout(function(){c.setStatus("")},1);b()},1)):b())}}
if(c.preInit)for("function"==typeof c.preInit&&(c.preInit=[c.preInit]);0<c.preInit.length;)c.preInit.pop()();Ca();
return Module.ready
}
);
})();
const initialize = (wasmPath) => {
return new Promise(resolve => {
Module({
locateFile() {
return wasmPath;
},
onRuntimeInitialized() {
resolve({
compileGLSLZeroCopy: this.compileGLSLZeroCopy,
compileGLSL: this.compileGLSL,
});
},
});
});
};
let instance;
export default (wasmPath) => {
if (!instance) {
instance = initialize(wasmPath);
}
return instance;
};
Regular → Executable
BIN
View File
Binary file not shown.
File diff suppressed because one or more lines are too long
Binary file not shown.
+5
View File
@@ -7,3 +7,8 @@ declare module 'external:emscripten/webgpu/glslang.js' {
function factory (wasmUrl: string): Promise<any>;
export default factory;
}
declare module 'external:emscripten/webgpu/twgsl.js' {
function factory (gfx: any): Promise<any>;
export default factory;
}
File diff suppressed because one or more lines are too long
BIN
View File
Binary file not shown.
Binary file not shown.
@@ -21,11 +21,4 @@
%include <javascriptinit.swg>
#define %module_macro(m) %feature("module_macro","m")
#define %release_returned_cpp_object_in_gc(method) %feature("release_returned_cpp_object_in_gc", "1") method
%define %virtual_inherit(klass)
%feature("virtual_inherit", "1") klass;
%typemap(in) klass *self
%{ $1 = SE_THIS_OBJECT_VIRTUAL<$*ltype, cc::VirtualInheritBase>(s);
if (nullptr == $1) return true;%}
%enddef
#define %release_returned_cpp_object_in_gc(method) %feature("release_returned_cpp_object_in_gc", "1") method
@@ -22,7 +22,8 @@ static bool $jswrapper(se::State& s) // NOLINT(readability-identifier-naming)
$js_check_arg_count
$jslocals
$jscode
$js_set_private_object
auto *ptr = JSB_MAKE_PRIVATE_OBJECT_WITH_INSTANCE(result);
s.thisObject()->setPrivateObject(ptr);
return true;
}
SE_BIND_CTOR($jswrapper, __jsb_$jsmangledname_class, js_delete_$jsdtor)%}
@@ -61,7 +62,8 @@ static bool $jswrapper(se::State& s) // NOLINT(readability-identifier-naming)
CC_UNUSED bool ok = true;
$jslocals
$jscode
$js_set_private_object
auto *ptr = JSB_MAKE_PRIVATE_OBJECT_WITH_INSTANCE(result);
s.thisObject()->setPrivateObject(ptr);
return true;
}
%}
@@ -84,20 +86,19 @@ static bool $jswrapper(se::State& s) // NOLINT(readability-identifier-naming)
/* -----------------------------------------------------------------------------
* js_dtor: template for a destructor wrapper
* - $classname_mangled: mangled class name
* - $jsmangledname: mangled class name
* - $jstype: class type
* ----------------------------------------------------------------------------- */
%fragment ("js_dtor", "templates")
%{
static bool $jswrapper(se::State& s) {
cc::invokeOnGarbageCollectMethod<$jsclass_type>(s);
return true;
}
SE_BIND_FINALIZE_FUNC($jswrapper) %}
/* -----------------------------------------------------------------------------
* js_dtor: template for a destructor wrapper
* - $classname_mangled: mangled class name
* - $jsmangledname: mangled class name
* - $jstype: class type
* - ${destructor_action}: The custom destructor action to invoke.
* ----------------------------------------------------------------------------- */
@@ -105,7 +106,6 @@ SE_BIND_FINALIZE_FUNC($jswrapper) %}
%{
static bool $jswrapper(se::State& s)
{
cc::invokeOnGarbageCollectMethod<$jsclass_type>(s);
return true;
}
SE_BIND_FINALIZE_FUNC($jswrapper) %}
Binary file not shown.
@@ -21,11 +21,4 @@
%include <javascriptinit.swg>
#define %module_macro(m) %feature("module_macro","m")
#define %release_returned_cpp_object_in_gc(method) %feature("release_returned_cpp_object_in_gc", "1") method
%define %virtual_inherit(klass)
%feature("virtual_inherit", "1") klass;
%typemap(in) klass *self
%{ $1 = SE_THIS_OBJECT_VIRTUAL<$*ltype, cc::VirtualInheritBase>(s);
if (nullptr == $1) return true;%}
%enddef
#define %release_returned_cpp_object_in_gc(method) %feature("release_returned_cpp_object_in_gc", "1") method
@@ -22,7 +22,8 @@ static bool $jswrapper(se::State& s) // NOLINT(readability-identifier-naming)
$js_check_arg_count
$jslocals
$jscode
$js_set_private_object
auto *ptr = JSB_MAKE_PRIVATE_OBJECT_WITH_INSTANCE(result);
s.thisObject()->setPrivateObject(ptr);
return true;
}
SE_BIND_CTOR($jswrapper, __jsb_$jsmangledname_class, js_delete_$jsdtor)%}
@@ -61,7 +62,8 @@ static bool $jswrapper(se::State& s) // NOLINT(readability-identifier-naming)
CC_UNUSED bool ok = true;
$jslocals
$jscode
$js_set_private_object
auto *ptr = JSB_MAKE_PRIVATE_OBJECT_WITH_INSTANCE(result);
s.thisObject()->setPrivateObject(ptr);
return true;
}
%}
@@ -84,20 +86,19 @@ static bool $jswrapper(se::State& s) // NOLINT(readability-identifier-naming)
/* -----------------------------------------------------------------------------
* js_dtor: template for a destructor wrapper
* - $classname_mangled: mangled class name
* - $jsmangledname: mangled class name
* - $jstype: class type
* ----------------------------------------------------------------------------- */
%fragment ("js_dtor", "templates")
%{
static bool $jswrapper(se::State& s) {
cc::invokeOnGarbageCollectMethod<$jsclass_type>(s);
return true;
}
SE_BIND_FINALIZE_FUNC($jswrapper) %}
/* -----------------------------------------------------------------------------
* js_dtor: template for a destructor wrapper
* - $classname_mangled: mangled class name
* - $jsmangledname: mangled class name
* - $jstype: class type
* - ${destructor_action}: The custom destructor action to invoke.
* ----------------------------------------------------------------------------- */
@@ -105,7 +106,6 @@ SE_BIND_FINALIZE_FUNC($jswrapper) %}
%{
static bool $jswrapper(se::State& s)
{
cc::invokeOnGarbageCollectMethod<$jsclass_type>(s);
return true;
}
SE_BIND_FINALIZE_FUNC($jswrapper) %}
+2 -2
View File
@@ -46,7 +46,7 @@ if(NOT USE_MODULES)
endif()
# add dependent boost libs
if(NOT NX)
if((NOT NX) AND (NOT EMSCRIPTEN))
include(${CMAKE_CURRENT_LIST_DIR}/boost-source/boost.cmake)
endif()
@@ -61,7 +61,7 @@ add_definitions(-DCC_SWAPPY_ENABLED)
endif()
if(ANDROID)
if(ANDROID AND (NOT SURFACE_LESS_SERVICE))
set(CC_GAME_ACTIVITY_SOURCES
${CMAKE_CURRENT_LIST_DIR}/android-gamesdk/GameActivity/game-activity/include/game-activity/GameActivity.cpp
${CMAKE_CURRENT_LIST_DIR}/android-gamesdk/GameActivity/game-activity/include/game-activity/system_utils.cpp
+4 -2
View File
@@ -139,5 +139,7 @@ glslang (Built using https://github.com/YunHsiao/glslang/tree/build)
linux: 11.5.0
openharmony:11.5.0 (commit: 1978c76)
swig ( Built using https://github.com/cocos/swig/tree/cocos-se, executable files are downloaded from https://github.com/cocos/swig/releases/tag/cocos-v1.1.7 )
all: cocos-v1.1.7 (commit: 7969da2)
swig ( Built using https://github.com/cocos/swig/tree/cocos-se, executable files are downloaded from https://github.com/cocos/swig/releases/tag/cocos-v1.1.6 )
win64: cocos-v1.1.6 (commit: f52be17)
mac: cocos-v1.1.6 (commit: f52be17)
linux: cocos-v1.1.6 (commit: f52be17)
Binary file not shown.
@@ -21,11 +21,4 @@
%include <javascriptinit.swg>
#define %module_macro(m) %feature("module_macro","m")
#define %release_returned_cpp_object_in_gc(method) %feature("release_returned_cpp_object_in_gc", "1") method
%define %virtual_inherit(klass)
%feature("virtual_inherit", "1") klass;
%typemap(in) klass *self
%{ $1 = SE_THIS_OBJECT_VIRTUAL<$*ltype, cc::VirtualInheritBase>(s);
if (nullptr == $1) return true;%}
%enddef
#define %release_returned_cpp_object_in_gc(method) %feature("release_returned_cpp_object_in_gc", "1") method
@@ -22,7 +22,8 @@ static bool $jswrapper(se::State& s) // NOLINT(readability-identifier-naming)
$js_check_arg_count
$jslocals
$jscode
$js_set_private_object
auto *ptr = JSB_MAKE_PRIVATE_OBJECT_WITH_INSTANCE(result);
s.thisObject()->setPrivateObject(ptr);
return true;
}
SE_BIND_CTOR($jswrapper, __jsb_$jsmangledname_class, js_delete_$jsdtor)%}
@@ -61,7 +62,8 @@ static bool $jswrapper(se::State& s) // NOLINT(readability-identifier-naming)
CC_UNUSED bool ok = true;
$jslocals
$jscode
$js_set_private_object
auto *ptr = JSB_MAKE_PRIVATE_OBJECT_WITH_INSTANCE(result);
s.thisObject()->setPrivateObject(ptr);
return true;
}
%}
@@ -84,20 +86,19 @@ static bool $jswrapper(se::State& s) // NOLINT(readability-identifier-naming)
/* -----------------------------------------------------------------------------
* js_dtor: template for a destructor wrapper
* - $classname_mangled: mangled class name
* - $jsmangledname: mangled class name
* - $jstype: class type
* ----------------------------------------------------------------------------- */
%fragment ("js_dtor", "templates")
%{
static bool $jswrapper(se::State& s) {
cc::invokeOnGarbageCollectMethod<$jsclass_type>(s);
return true;
}
SE_BIND_FINALIZE_FUNC($jswrapper) %}
/* -----------------------------------------------------------------------------
* js_dtor: template for a destructor wrapper
* - $classname_mangled: mangled class name
* - $jsmangledname: mangled class name
* - $jstype: class type
* - ${destructor_action}: The custom destructor action to invoke.
* ----------------------------------------------------------------------------- */
@@ -105,7 +106,6 @@ SE_BIND_FINALIZE_FUNC($jswrapper) %}
%{
static bool $jswrapper(se::State& s)
{
cc::invokeOnGarbageCollectMethod<$jsclass_type>(s);
return true;
}
SE_BIND_FINALIZE_FUNC($jswrapper) %}