@@ -2467,3 +2467,81 @@ int b3SetVRCameraTrackingObject(b3SharedMemoryCommandHandle commandHandle, int o
2467
2467
return 0 ;
2468
2468
}
2469
2469
2470
+ b3SharedMemoryCommandHandle b3StateLoggingCommandInit (b3PhysicsClientHandle physClient)
2471
+ {
2472
+ PhysicsClient* cl = (PhysicsClient*)physClient;
2473
+ b3Assert (cl);
2474
+ b3Assert (cl->canSubmitCommand ());
2475
+ struct SharedMemoryCommand * command = cl->getAvailableSharedMemoryCommand ();
2476
+ b3Assert (command);
2477
+
2478
+ command->m_type = CMD_STATE_LOGGING;
2479
+ command->m_updateFlags = 0 ;
2480
+ command->m_stateLoggingArguments .m_numBodyUniqueIds = 0 ;
2481
+
2482
+ return (b3SharedMemoryCommandHandle)command;
2483
+
2484
+ }
2485
+
2486
+ int b3StateLoggingStart (b3SharedMemoryCommandHandle commandHandle, int loggingType, const char * fileName)
2487
+ {
2488
+ struct SharedMemoryCommand * command = (struct SharedMemoryCommand *) commandHandle;
2489
+ b3Assert (command);
2490
+ b3Assert (command->m_type == CMD_STATE_LOGGING);
2491
+ if (command->m_type == CMD_STATE_LOGGING)
2492
+ {
2493
+ command->m_updateFlags |= STATE_LOGGING_START_LOG;
2494
+ int len = strlen (fileName);
2495
+ if (len < MAX_FILENAME_LENGTH)
2496
+ {
2497
+ strcpy (command->m_stateLoggingArguments .m_fileName , fileName);
2498
+ }
2499
+ else
2500
+ {
2501
+ command->m_stateLoggingArguments .m_fileName [0 ] = 0 ;
2502
+ }
2503
+ command->m_stateLoggingArguments .m_logType = loggingType;
2504
+ }
2505
+ return 0 ;
2506
+ }
2507
+
2508
+ int b3GetStatusLoggingUniqueId (b3SharedMemoryStatusHandle statusHandle)
2509
+ {
2510
+ const SharedMemoryStatus* status = (const SharedMemoryStatus* ) statusHandle;
2511
+ b3Assert (status);
2512
+ b3Assert (status->m_type == CMD_STATE_LOGGING_START_COMPLETED);
2513
+ if (status && status->m_type == CMD_STATE_LOGGING_START_COMPLETED)
2514
+ {
2515
+ return status->m_stateLoggingResultArgs .m_loggingUniqueId ;
2516
+ }
2517
+ return -1 ;
2518
+ }
2519
+
2520
+ int b3StateLoggingAddLoggingObjectUniqueId (b3SharedMemoryCommandHandle commandHandle, int objectUniqueId)
2521
+ {
2522
+ struct SharedMemoryCommand * command = (struct SharedMemoryCommand *) commandHandle;
2523
+ b3Assert (command);
2524
+ b3Assert (command->m_type == CMD_STATE_LOGGING);
2525
+ if (command->m_type == CMD_STATE_LOGGING)
2526
+ {
2527
+ command->m_updateFlags |= STATE_LOGGING_FILTER_OBJECT_UNIQUE_ID;
2528
+ if (command->m_stateLoggingArguments .m_numBodyUniqueIds < MAX_SDF_BODIES)
2529
+ {
2530
+ command->m_stateLoggingArguments .m_bodyUniqueIds [command->m_stateLoggingArguments .m_numBodyUniqueIds ++] = objectUniqueId;
2531
+ }
2532
+ }
2533
+ return 0 ;
2534
+ }
2535
+ int b3StateLoggingStop (b3SharedMemoryCommandHandle commandHandle, int loggingUid)
2536
+ {
2537
+ struct SharedMemoryCommand * command = (struct SharedMemoryCommand *) commandHandle;
2538
+ b3Assert (command);
2539
+ b3Assert (command->m_type == CMD_STATE_LOGGING);
2540
+ if (command->m_type == CMD_STATE_LOGGING)
2541
+ {
2542
+ command->m_updateFlags |= STATE_LOGGING_STOP_LOG;
2543
+ command->m_stateLoggingArguments .m_loggingUniqueId = loggingUid;
2544
+ }
2545
+ return 0 ;
2546
+ }
2547
+
0 commit comments